【问题标题】:UIScrollBar is adding a vertical offset when scrolled manuallyUIScrollBar 在手动滚动时添加垂直偏移
【发布时间】:2015-09-16 14:40:06
【问题描述】:

我有一个奇怪的行为问题:

我在 ScrollView 中有一个 WebView。 WebView 的声明如下:

let webView = UIWebView(frame:CGRectMake(x,0,self.bounds.width,webPageScroller!.frame.height))

其中 x 由调用者给出。现在,您会认为这会将我的 WebView 放在左上角,但不,有一个固定的垂直偏移量,我无法摆脱它。

现在,我还通过调用以编程方式滚动:

webScroller.setContentOffset(offset, animated: true)

其中 offset 是 CGPointZero 并且分离消失了。但是,只要我水平滚动,它就会回来。

这让我发疯了。帮助。

【问题讨论】:

    标签: ios swift uiscrollview uiwebview


    【解决方案1】:

    事实证明,我只需要进入 Interface Builder 并取消选中“调整滚动视图插图”。

    【讨论】:

      猜你喜欢
      • 2017-02-10
      • 2012-03-06
      • 1970-01-01
      • 2021-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-25
      • 2022-01-21
      相关资源
      最近更新 更多