我正在开发一个兼容iOS 7的应用程序。我的状态栏内容如网络,电池寿命等出现在我的标题图片中。请看一下屏幕截图,请指导我如何解决这个问题。
**此应用与iOS> = 5.0 SDK兼容。
答案 0 :(得分:1)
您有几种选择。例如:
1)您可以在编辑故事板/笔尖时在尺寸检查器中使用iOS 6/7 Deltas。
2)您可以在代码中检测iOS并移动
的所有视图#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 :(得分:0)
试试这个:
-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}