修复在IOS7下面,PhoneGap App的全屏问题

作者 happyWang 日期 2013-12-09 Views
修复在IOS7下面,PhoneGap App的全屏问题

In MainViewController.m, add:

- (void)viewDidLayoutSubviews{

if ([self respondsToSelector:@selector(topLayoutGuide)]) // iOS 7 or above
{
CGFloat top = self.topLayoutGuide.length;
if(self.webView.frame.origin.y == 0){
// We only want to do this once, or if the view has somehow been “restored” by other code.
self.webView.frame = CGRectMake(self.webView.frame.origin.x, self.webView.frame.origin.y + top, self.webView.frame.size.width, self.webView.frame.size.height - top);
}
}
}

[caption id=”attachment_315” align=”alignnone” width=”300”]在MainViewController.m中添加代码 在MainViewController.m中添加代码[/caption] 参考文章地址:http://community.phonegap.com/nitobi/topics/inconsistent\_ios\_7\_status\_bar\_build\_problem