1.解决statusBar遮盖navigation
self.navigationController.navigationBar.translucent = NO;
[UIApplication sharedApplication].statusBarHidden = NO;
2.解决statusBar隐藏留下黑色或白色区域
self.wantsFullScreenLayout = YES;
或者 self.view.frame = [[UIScreen mainScreen] applicationFrame];
3.解决statusBar不能隐藏的问题
- (BOOL)prefersStatusBarHidden
{
return YES;
}
4.statusBar颜色
iOS7后 UIApplication的setStatusBarXXX
方法都不起作用了,要将UIViewControllerBasedStatusBarAppearance
设置为NO后才起作用
[[UIApplicationsharedApplication]setStatusBarStyle:UIStatusBarStyleBlackTranslucent
animated:YES]; 或
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
5.解决ios7 20像素留白
self.edgesForExtendedLayout = UIRectEdgeNone;