3 回答

TA貢獻1786條經驗 獲得超13個贊
我在另一個線程上找到了答案,但是如果有人懷疑,我會回答這個問題。
只需將viewWillAppearin 替換為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.
// 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];
}

TA貢獻1804條經驗 獲得超3個贊
除了路德維?!た死锼雇懈ド↙udwig Kristoffersson)的尺寸調整功能外,我建議更改狀態(tài)欄顏色:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
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;
}
self.view.backgroundColor = [UIColor blackColor];
}
-(UIStatusBarStyle)preferredStatusBarStyle{
return UIStatusBarStyleLightContent;
}
- 3 回答
- 0 關注
- 577 瀏覽
添加回答
舉報