Android WebView 可滚动
我正在制作一个基于 android WebView 类的浏览器。我想在 webview 上启用水平和垂直滚动,并希望它的行为与 android 浏览器完全相同?清单文件中是否有任何设置,或者我应该覆盖默认的 webviewclient 类。
I'm making a browser based on android WebView class. I want to enable both horizontal and vertical scrolls on the webview and want it to behave exactly like the android browser? Is there any setting for that in the manifest file or shall i override the default webviewclient class.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WebView 文档 说:
它还说:
这表明
WebViewClient
与滚动条无关,因为它们不是内容。我本来建议将
WebView
放在ScrollView
中,但看看 此链接 看来 WebView 的默认行为是包含滚动条,这是有道理的,因为许多滚动条功能是在高级View
类中定义的。您是否尝试过制作常规的 WebView?如果是这样,您是否尝试在 java 代码中添加以下内容?The WebView documentation says:
It also says:
Which suggests
WebViewClient
has nothing to do with the scroll bars, since they're not content.I was going to suggest putting a
WebView
inside of aScrollView
, but looking at this link it seems WebView's default behaviour is to include scroll bars, which makes sense since a lot of scrollbar functionality is defined in the high levelView
class. Have you tried just making a regular WebView? If so, have you tried adding the following in your java code?