我正在开发一个使用 html5
、css3
和 angularJS
开发的跨平台应用程序。
我在 Android 设备上显示 ScrollBar
时遇到问题。
我已经使用了-webkit-overflow-scrolling: touch;
它在 iPAD 上运行良好,但在 Android 设备上无效。 需要帮助。
提前致谢
最佳答案
正如您所说的那样,Android 原生 WebView 在使用 overflow:scroll|auto
时不会“显示”滚动条。但是当您触摸并四处移动容器时允许滚动。所以滚动应该仍能按预期工作,没有 flex 效果。
另一个 Android 问题是直到 4.4,原生 WebView 不是 Chrome 中使用的,即 ChromeView。所以你将不得不使用 javascript polyfill 来处理它,比如 overthrow.js [http://filamentgroup.github.io/Overthrow/] 或 iscroll。就个人而言,iscroll ux 在 Samsung Galaxy Tabs 上很糟糕。
但如果您的目标是 Android 4.0>=,那么这可能会有所帮助 https://github.com/pwnall/chromeview .虽然还没有亲自尝试过。
查看有关 webview 更改的更多详细信息 https://developers.google.com/chrome/mobile/docs/webview/overview
Android 4.4 (KitKat) includes a new WebView component based on the Chromium open source project. ...[truncated]...., so rendering should be much more consistent between the WebView and Chrome.
关于android - 难以在 Android 设备上显示跨平台应用程序的滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22037072/