我刚刚将iOS PhoneGap应用程序升级到Cordova 2.1.应用程序构建正常,但在模拟器上运行时,应用程序的内容似乎完全忽略状态栏存在的事实.现在状态栏下面隐藏了20px的内容,我似乎无法添加填充以将其向下移动.
我该如何解决?
如果您将应用程序升级为从另一个版本使用PhoneGap 2.1,则您的MainViewController.m文件可能不是最新的.
您需要在其中包含以下代码:
#pragma mark - View lifecycle
- (void)viewWillAppear:(BOOL)animated
{
// Set the main view to utilize the entire application frame space of the device.
// Change this to suit your view's UI footprint needs in your application.
self.view.frame = [[UIScreen mainScreen] applicationFrame];
[super viewWillAppear:animated];
}
Run Code Online (Sandbox Code Playgroud)
一旦你有这个功能,你的应用程序将恢复正常!
(此处找到解决方案)
| 归档时间: |
|
| 查看次数: |
1201 次 |
| 最近记录: |