3 回答
TA貢獻(xiàn)1786條經(jīng)驗(yàn) 獲得超13個(gè)贊
我在另一個(gè)線程上找到了答案,但是如果有人懷疑,我會(huì)回答這個(gè)問(wèn)題。
只需將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貢獻(xiàn)1804條經(jīng)驗(yàn) 獲得超3個(gè)贊
除了路德維?!た死锼雇懈ド↙udwig Kristoffersson)的尺寸調(diào)整功能外,我建議更改狀態(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 關(guān)注
- 588 瀏覽
添加回答
舉報(bào)
