简体   繁体   English

UIWebView不会滚动到结尾/底部

[英]UIWebView won't scroll till the end / bottom

I have the same problem as described here: UIWebView doesn't scroll to the bottom of the webpage loaded/created (unfortunately nobody answered there) 我有与此处描述的相同的问题: UIWebView不会滚动到加载/创建的网页的底部 (很遗憾没人在那里回答)

I have a UIWebView with inside UIView, and it doesn't scroll to the bottom, it's actually possible to scroll it but it is bouncing back again, so I can't see about bottom 100 px of my WebView, what can it be? 我有一个内部UIView的UIWebView,它不会滚动到底部,它实际上可以滚动它但它再次反弹,所以我看不到我的WebView底部100 px,它可以是什么?

Thank you 谢谢

对不起家伙,是我的错,我只是要减少WebView的高度

I got this problem today. 我今天遇到了这个问题。 I had set the constraints wrt iPhone 4 inch screen. 我已经设置了iPhone 4英寸屏幕的限制。 So when I executed the app on iPhone 3.5 inch screen, it didn't show the bottom part. 因此,当我在iPhone 3.5英寸屏幕上执行应用程序时,它没有显示底部部分。

The solution was to go to the Interface Builder and click the button to go to 3.5 inch form factor. 解决方案是转到Interface Builder并单击按钮以转到3.5英寸外形。 (the one which alternates between 3.5 and 4 inch form factor). (在3.5和4英寸外形之间交替的那个)。

Then select 'Webview'. 然后选择“Webview”。

Editor > Resolve Autolayout Issues > Add missing constraints 编辑器>解决Autolayout问题>添加缺少的约束

This solution is for Xcode 5. 此解决方案适用于Xcode 5。

If you can't scroll to the bottom end properly using UIWebView : 如果使用UIWebView无法正确滚动到底端:

1) One way (Programmatically) to solve the problem is using proper autosizing to UIWebView . 1)解决问题的一种方法(以编程方式)是对UIWebView使用适当的自动调整。

self.webView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin ;

在此输入图像描述

2) Other way (Interface Builder) to solve the problem is using proper autosizing to UIWebView . 2)解决问题的其他方法(Interface Builder)是对UIWebView使用适当的自动调整。 Go to Interface Builder->Web View->Size Inspector and tick autosizing parts in all places (As seen on Image above) 转到Interface Builder-> Web View-> Size Inspector并勾选所有位置的自动调整部件(如上图所示)

不要忘记为Web视图禁用Autolayout!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM