Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIWebView is not displaying all content!

I am surprised I haven't seen many entries for this issue. I can't find a solution for it. Any help will be appreciated.

I have a UIWebView, which displays MOST of the content in my website but always cutting off some of the content at the bottom and I can't scroll down to it.

When I try to scroll to it (swiping up), I can see the rest of the content but I get the "bounce" effect as soon as I release the swipe so I don't actually get to scroll to the rest of it. (i.e., the UIWebView bounces back cutting off the content).

I tried with another site, on which I can scroll, but the same happened. The last 100 or so pixels get cut off and I can't get to it.

Has anyone else seen this? Is there a solution for it? Thank you Polo

like image 431
PoloGV Avatar asked Mar 01 '11 16:03

PoloGV


2 Answers

Check and make sure your UIWebView isn't larger than the bounds of your view/screen. It sounds like it's taller than the view it's embedded in (or your device's viewable area) and the last ~100px are rendered correctly off-screen, giving the impression that you can pull them to view but they always snap back to their default position outside of your visible area.

like image 51
Dominic Avatar answered Oct 11 '22 01:10

Dominic


This is over 3 years old, but I realized that dominic does not point to the right solution.

To get the scroll view to show all content while scrolling, follow through:

  1. go to your storyboard

  2. click on the parent view that contains your UIWebview

  3. In the right panel, click on File Inspector button, then locate the Auto Layout and deselect it

  4. then, click on the UIScrollview

  5. click on the Size Inspector

  6. make sure everything in the autosizing box is selected (all 4 directions inside and outside the

    small box). That will make your scroll view expand or shrink if necessary.

that should get the scrollview inside the uiwebview to work properly.

like image 41
oabarca Avatar answered Oct 11 '22 02:10

oabarca