PhoneGap中文网

 找回密码
 立即注册
查看: 19336|回复: 5
打印 上一主题 下一主题

Phonegap在ios7上系统状态栏的问题解决

[复制链接]

493

主题

2035

帖子

6894

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
6894
跳转到指定楼层
楼主
发表于 2013-12-4 17:25:38 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
phonegap+jqm开发的应用,在ios6下没问题,但是在ios7下会出现如下系统状态栏和header重合的问题,搜索了一下,发现这其实是phonegap当前版本的一个已知问题,通过修改./platforms/ios/whhe/Classes/MainViewController.m,就可以解决
  1. [objc] view plaincopy

  2.     - (void)viewWillAppear:(BOOL)animated  
  3.     {  
  4.     // View defaults to full size.  If you want to customize the view's size, or its subviews (e.g. webView),  
  5.     // you can do so here.  
  6.     //Lower screen 20px on ios 7  
  7.     if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {  
  8.         CGRect viewBounds = [self.webView bounds];  
  9.         viewBounds.origin.y = 20;  
  10.         viewBounds.size.height = viewBounds.size.height - 20;  
  11.         self.webView.frame = viewBounds;  
  12.     }  
  13.     [super viewWillAppear:animated];  
  14.     }  
复制代码




参考:

http://www.tuicool.com/articles/YRzIJn

http://stackoverflow.com/questio ... s-bar-with-phonegap
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

ionic4视频教程

Archiver|手机版|小黑屋| PhoneGap中文网 ( 京ICP备13027796号-1 )  

GMT+8, 2024-5-17 12:42 , Processed in 0.039535 second(s), 29 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表