Status bar appearing at header image
我正在开发一个与 iOS 7 兼容的应用程序。我的状态栏内容(如网络、电池寿命等)出现在我的标题图像中。请看一下屏幕截图,并请指导我如何解决这个问题。
** 此应用兼容 iOS>=5.0 SDK。
您有多种选择。例如:
1) 在编辑故事板/笔尖时,您可以在尺寸检查器中使用 iOS 6/7 Deltas。
2) 可以在代码中检测 iOS 并移动
的所有视图
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) //in viewDidLoad if (SYSTEM_VERSION_LESS_THAN(@"7.0")) { CGRect frame = m_web_view.frame; frame.origin.y = 0; frame.size.height += 20; m_web_view.frame = frame; } |
3) 可以隐藏状态栏
试试这个:
1 2 | -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{ [[UIApplication sharedApplication] setStatusBarHidden:YES]; |
}