开发者

UIWebView is not displaying all content!

开发者 https://www.devze.com 2023-02-14 16:48 出处:网络
I am surprised I haven\'t seen many entries for this issue. 开发者_如何学JAVAI can\'t find a solution for it. Any help will be appreciated.

I am surprised I haven't seen many entries for this issue. 开发者_如何学JAVAI 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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消