用Phonegap+jqm开发的应用,在ios6下没问题,但是在ios7下会出现如下系统状态栏和header重合的问题,这时候我们可以用以下办法,使得状态栏和我们的应用分离:Classes中找到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];
}这样就解决问题了。
本文介绍了一个针对iOS7设备上PhoneGap+JQM应用的状态栏与header重叠问题的解决方案。通过调整MainViewController.m文件中的webView位置,使状态栏与应用内容分离。
1281

被折叠的 条评论
为什么被折叠?



