UIWebView 不会滚动到加载/创建的网页底部 [英] UIWebView doesn't scroll to the bottom of the webpage loaded/created

查看:48
本文介绍了UIWebView 不会滚动到加载/创建的网页底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在普通的 UIViewController 中有一个 UIWebView.UIWebView 的内容是在我的程序中编程/动态创建的,它可能很长(多个表行).不知何故,加载后,在屏幕上滑动时页面不会滚动超过一屏半的内容.因此,我只能看到开头的几行数据,而看不到它们之后的许多其他数据.这是为什么?

I have a UIWebView inside a normal UIViewController. The content of the UIWebView is programming/dynamically created in my program, and it could be very long (multiple table rows). Somehow, after loading, the page won't scroll more then one and half screen of content when swipe on the screen. Because of that I can only see the beginning few rows of data, but not the many others after them. Why is that?

推荐答案

如果使用 UIWebView 无法正确滚动到底部:

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

1) 解决问题的一种方法(以编程方式)是对 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) 解决问题的其他方法(Interface Builder)是对 UIWebView 使用适当的自动调整大小.转到 Interface Builder->Web View->Size Inspector 并在所有位置勾选自动调整部分(如上图所示)

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)

这篇关于UIWebView 不会滚动到加载/创建的网页底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆