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

phonegap3+,ios7+ 状态栏问题的解决

2015-02-10 15:30 113 查看
使用phonegap混合开发时,在ios7+的设备中会出现系统状态栏和header重合的问题,加入代码使得状态栏和我们的应用分离:

MainViewController.m

- (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.
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];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: