HTML 中的可滚动内容不会在 android 模拟器或手机中滚动 [英] Scrollable content inside an HTML does not scroll in android emulator or phone

查看:45
本文介绍了HTML 中的可滚动内容不会在 android 模拟器或手机中滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示一些 HTML 内容的 WebView.在我的 HTML 中,我放置了 overflow-y: scroll 特定的 div.现在,当项目数超过 div 的区域时,div 不会滚动.任何人有任何想法,请提出建议.

I have a WebView that displays some HTML content. Inside my HTML I have placed overflow-y: scroll for a particular div. Now when the number of items exceed the area of the div the div does not scroll. Anyone having any idea, please suggest.

overflow-y:自动也无济于事.

overflow-y: auto doesn't help either.

推荐答案

Android 3.0 及更高版本支持 overflow:, on <3.0是另一个故事.您可能会使用诸如 iScroll 之类的 polyfill 取得一些成功,但这确实是有代价的.在布局复杂的站点上实现起来很困难,每次站点上的内容发生变化时都需要调用一个方法.内存使用也是一个问题:在已经功率不足的设备上,性能可能会因为这些类型的 polyfill 而滞后.

Android 3.0 and higher have support for overflow:, on < 3.0 it's another story. You might have some success with polyfills like iScroll, however that does come at a cost. It's difficult to implement on sites with complex layouts, and you need to a call a method everytime the content on your site changes. Memory use is also an issue: on already underpowered devices performance may lag because of these kinds of polyfills.

这是手机上Scrollable DIV的对比

Here is a comparison of Scrollable DIV on mobile phones

我认为这将帮助您找到最佳解决方案.我建议使用 iScroll 或 touchScroll 来解决您的问题.

I think this will help you to find the best solution. I recommend to use iScroll OR touchScroll for your issue.

这篇关于HTML 中的可滚动内容不会在 android 模拟器或手机中滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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