如何防止 UIWebView 滚动超过其边界?
我有一个以 UIWebView
作为子视图的视图,以及一些其他(固定)子视图。我希望 UIWebView 可以向各个方向滚动,但我不希望用户能够将内容拖动到其自然边界之外,如下所示:
在此图像中,我将 Web 视图的内容向下和向右拖动,如您所见,内容超出了顶部和左侧边界。我希望当这种情况发生时,内容正好停在边缘,这样下面就不会暴露任何灰色区域。
这可能吗?
I have a view with a UIWebView
as a sub-view, along with some other (fixed) subviews. I want the UIWebView
to be scrollable in every direction, but I don't want the user to be able to drag the contents past their natural boundaries, as illustrated here:
In this image, I'm dragging the webview's contents down and to the right, and as you can see the contents go past their top and left boundaries. I want the contents to just stop right at the edges when this happens, so that no gray area is exposed underneath.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以试试这个:
You can try this: