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中添加代码[/caption] 参考文章地址:http://community.phonegap.com/nitobi/topics/inconsistent\_ios\_7\_status\_bar\_build\_problem
原创内容,欢迎转载 😊