Tabbar和webview之间的空白 - iOS7

时间:2013-10-10 07:15:48

标签: iphone ios7

我正在使用webview在iOS7中遇到麻烦。它显示了我的webview和tabbar之间的空白区域。 以下是我的场景镜头和代码。请帮帮我。

- (void)viewDidLoad {
    [super viewDidLoad];

    CGRect rectFrame = [UIScreen mainScreen].applicationFrame;
    self.view.frame = rectFrame;
    self.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

    // demoWebview is my Webview 
    demoWebView.autoresizesSubviews = YES;
    demoWebView.scalesPageToFit = YES;
    demoWebView.backgroundColor = [UIColor whiteColor];

    UIBarButtonItem *backButton = [[UIBarButtonItem alloc]initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(onBack:)];
    self.navigationItem.leftBarButtonItem = backButton;
    [backButton release];

}

1 个答案:

答案 0 :(得分:0)

我解决了这个问题,添加了以下代码:

if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) 
{
    self.edgesForExtendedLayout = UIRectEdgeNone;
}