问:
有没有人知道一种方法,用PhoneGap的应用解决iOS 7上状态栏的问题?我试图抵消整个网页的CSS,但它似乎并没有运行。有没有办法实现像抵消整个的UIWebView或只是让状态栏像它在iOS6的那样?
谢谢
答:
我在其他的地方发现了答案,但是我回答问题在某些情况下也有其他人感到疑惑。
在MainViewController.m文件中使用以下的代码替换viewWillAppear,代码如下:
-
- (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.
-
//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];
-
}
温馨提示:您的支持与理解,是我们工作最大的动力。如果您是从网上购买的图书,请在对应的网店,给予本书一个好评,我们将衷心感谢!!!
以下是《Objective-C函数速查实例手册》对应的购书评论地址:
当当网:http://product.dangdang.com/23419761.html
亚马逊:http://www.amazon.cn/dp/B00IGDBUL6
京东网:http://item.jd.com/11406209.html
评论