phonegap3+,ios7+ 状态栏问题的解决

来源:互联网 发布:淘宝会员哪几种 编辑:程序博客网 时间:2024/06/15 20:31

使用phonegap混合开发时,在ios7+的设备中会出现系统状态栏和header重合的问题,加入代码使得状态栏和我们的应用分离:

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];}


0 0
原创粉丝点击