第一步:在pist文件添加 View controller-based status bar appearance 字段并设为YES
第二步:在controller中添加如下代码
-
(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;
self.webView.frame = viewBounds;
}[super viewWillAppear:animated];
这样就完美的去掉的状态栏的高度
网友评论