用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];
}
这样就解决问题了。