ios随意纪录

1.隐藏状态栏,再plist中添加如下属性

View controller-based status bar appearance = NO;

Status bar is initially hidden = YES


1.1.MB!!!!!!打开新的UIController突然出现状态栏,草草草草

在打开这个viewController的Controller中加入

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated

{

    [[UIApplication sharedApplication] setStatusBarHidden:YES];

}



2。文件不用arc

在Build phases的Compile Source项里,添加-fno-objc-arc


3.滑动子组件uiscrollview不滚动

setUserInteractionEnabled:NO


4.UIScrollView 设置ContentSize:

-(void)viewDidLayoutSubviews;


5.手动旋转UIViewController:

[[UIApplication sharedApplication]setStatusBarOrientation:UIInterfaceOrientationLandscapeLeftanimated:YES];

CGFloat duration = [UIApplicationsharedApplication].statusBarOrientationAnimationDuration;

 [UIView beginAnimations:nilcontext:nil];

 [UIView setAnimationDuration:duration];


你可能感兴趣的:(ios)