您的位置:首页 > 移动开发 > IOS开发

[Phonegap+Sencha Touch] 移动开发20 IOS7状态栏问题

2014-08-06 01:23 423 查看
在使用phonegap3.0的过程中,编译好的APP运行在IOS7系统上默认是与状态栏重叠的,而运行在IOS6及老版本中时是于状态栏分离的,如下图:



解决办法:

把文件MainViewController.m中的方法viewWillAppear改成下面这样:
- (void)viewWillAppear:(BOOL)animated
{
// View defaults to full size.  If you want to customize the view's size, or its subviews (e.g. webView),
// you can do so here.
//Lower screen 20px on ios 7
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
CGRect viewBounds = [self.webView bounds];
viewBounds.origin.y = 20;
viewBounds.size.height = viewBounds.size.height - 20;
self.webView.frame = viewBounds;
}
[super viewWillAppear:animated];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐