cordova ios 视图导航条下移20px

  • 内容
  • 评论
  • 相关

添加以下代理

- (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.

    self.view.backgroundColor = [UIColor orangeColor]; //设置 背景颜色

    // 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];

    //[super viewWillAppear:animated];

}

评论

0条评论

发表评论

电子邮件地址不会被公开。