【问题标题】:I removed the status bar from my iPad app, but now there is a white bar at the bottom that is the same thickness as the status bar我从 iPad 应用程序中删除了状态栏,但现在底部有一个与状态栏厚度相同的白色栏
【发布时间】:2014-03-25 03:18:16
【问题描述】:

似乎程序只是将整个视图向上移动,并没有拉伸 webView 以覆盖底部。

既然状态栏没有占用任何空间,我怎样才能让 webView 占据整个空间?我尝试在情节提要中手动使 webView 变大,但没有效果。

【问题讨论】:

    标签: ios ipad webview statusbar


    【解决方案1】:

    我在自己的 iPhone 应用中遇到了同样的问题。试试这个:

    - (void)viewDidLayoutSubviews
    {
        self.webView.frame = self.view.bounds;
    }
    

    【讨论】:

    • 没问题。编码愉快!
    【解决方案2】:
    • 是的,删除状态栏实际上是在做什么?

      通过删除状态栏,您可以释放与占用状态栏一样多的像素的视图空间。 所以,现在你的视图有大约“20px”的大小,所以它会显示那条白线 实际上是放置“UIControls”的持有者视图(不是一行)。

      *为此,您可以设置 UIControl 的大小以查看或使用自动调整大小选项 *

    • self.yourwebview.frame = self.view.bounds;

      OR
      

      你可以设置webview的属性

    【讨论】:

      猜你喜欢
      • 2015-11-11
      • 1970-01-01
      • 2012-12-17
      • 2021-09-25
      • 2011-03-03
      • 1970-01-01
      • 2018-03-06
      • 2018-10-05
      • 1970-01-01
      相关资源
      最近更新 更多