ScrollBar 在手动滚动时添加垂直偏移
UIScrollBar is adding a vertical offset when scrolled manually
我有一个奇怪的行为问题:
我在 ScrollView 中有一个 WebView。 WebView 声明如下:
let webView = UIWebView(frame:CGRectMake(x,0,self.bounds.width,webPageScroller!.frame.height))
其中 x 由来电者提供。现在,您可能认为这会将我的 WebView 放在左角,但不,有一个固定的垂直偏移量,我无法摆脱它。
现在,我还通过调用以编程方式滚动:
webScroller.setContentOffset(offset, animated: true)
偏移量为 CGPointZero,分离消失。但是,一旦我水平滚动它就会回来。
这让我抓狂。帮助。
事实证明,我只需要进入 Interface Builder 并取消勾选 "Adjust scroll view inset"。
我有一个奇怪的行为问题:
我在 ScrollView 中有一个 WebView。 WebView 声明如下:
let webView = UIWebView(frame:CGRectMake(x,0,self.bounds.width,webPageScroller!.frame.height))
其中 x 由来电者提供。现在,您可能认为这会将我的 WebView 放在左角,但不,有一个固定的垂直偏移量,我无法摆脱它。
现在,我还通过调用以编程方式滚动:
webScroller.setContentOffset(offset, animated: true)
偏移量为 CGPointZero,分离消失。但是,一旦我水平滚动它就会回来。
这让我抓狂。帮助。
事实证明,我只需要进入 Interface Builder 并取消勾选 "Adjust scroll view inset"。