- (void)viewWillAppear:(BOOL)animated {
self.view.backgroundColor = [UIColor redColor]; //设置 背景颜色
// 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.
// Lower screen 20px on ios 7
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];
}
From: http://stackoverflow.com/questions/19209781/ios-7-status-bar-with-phonegap
本文介绍如何在iOS7中调整PhoneGap应用的状态栏及webView的位置,确保应用界面在不同iOS版本上的一致性。通过修改viewWillAppear方法,实现对webView位置的微调。

9781

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



