Burjua
Burjua

Reputation: 12726

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)

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

Upvotes: 8

Views: 7258

Answers (4)

KiRviz
KiRviz

Reputation: 148

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

Upvotes: 0

Bilbo Baggins
Bilbo Baggins

Reputation: 3692

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.

Upvotes: 7

Alphapico
Alphapico

Reputation: 3043

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 ;

enter image description here

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)

Upvotes: 5

Burjua
Burjua

Reputation: 12726

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

Upvotes: 15

Related Questions