UIWebView won't scroll till the end / bottom

安稳与你 提交于 2019-12-04 12:15:53

问题


I have the same problem as described here: UIWebView doesn't scroll to the bottom of the webpage loaded/created (unfortunately nobody answered there)

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?

Thank you


回答1:


Sorry guys, was my fault, I just had to reduce the height of the WebView




回答2:


I got this problem today. I had set the constraints wrt iPhone 4 inch screen. So when I executed the app on iPhone 3.5 inch screen, it didn't show the bottom part.

The solution was to go to the Interface Builder and click the button to go to 3.5 inch form factor. (the one which alternates between 3.5 and 4 inch form factor).

Then select 'Webview'.

Editor > Resolve Autolayout Issues > Add missing constraints

This solution is for Xcode 5.




回答3:


If you can't scroll to the bottom end properly using UIWebView:

1) One way (Programmatically) to solve the problem is using proper autosizing to 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. Go to Interface Builder->Web View->Size Inspector and tick autosizing parts in all places (As seen on Image above)




回答4:


Don't forget to disable Autolayout for the web view!



来源:https://stackoverflow.com/questions/3290697/uiwebview-wont-scroll-till-the-end-bottom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!