我目前来自第三方的JavaScript库滚动到纯滚动转换一个非常大的PhoneGap应用程序中的滚动行为。一切都很顺利,除了在Android版的原生滚动永远不会显示滚动条。
I am currently converting the scroll behavior on a very large PhoneGap application from a third party JavaScript scrolling library to native scroll. Everything has gone smoothly, except that the native scroll on the Android version never displays a scrollbar.
滚动行为工作正常,但没有滚动条显示提供有关在屏幕上滚动位置的用户反馈。
The scroll behavior works correctly, but no scrollbar is displayed to give the user feedback about the scroll position on a screen.
我怀疑这是某种形式的配置或CSS问题,但我已尽力修改CSS和其他Android的配置文件,如清单和活动文件无济于事。
I suspect that this is some sort of configuration or CSS problem, but I have tried modifying CSS and other Android configuration files such as the manifest and activity files to no avail.
我如何能够使用本地卷轴上的PhoneGap的Android可见的滚动条?
How do I enable a visible scrollbar using native scroll on PhoneGap Android?
注:我的没有的兴趣第三方滚动溶液(如iScroll)。从iScroll转换已经是90%,除了在Android上看到滚动条问题做了。
Note: I am not interested in a third party scrolling solution (such as iScroll). The conversion from iScroll is already 90% done with the exception of the visible scrollbar problem on Android.
推荐答案
我能够通过使用仅得到在Android应用的Webkit滚动条CSS来实现这一点我自己。我对Android的滚动条类添加到Android上的页面通过
I was able to accomplish this myself by using Webkit scrollbar CSS that only gets applied on Android. I add the android-scroll-bar class to the page on Android by using
$('html').addClass('android-scroll-bar');
下面是必要的CSS:
.android-scroll-bar ::-webkit-scrollbar {width: 5px;}
.android-scroll-bar ::-webkit-scrollbar-track { border-radius: 10px;}
.android-scroll-bar ::-webkit-scrollbar-thumb { border-radius: 10px; background: rgb(169,169,169); }
.android-scroll-bar ::-webkit-scrollbar-thumb:window-inactive {background: rgb(128,128,128); }
相关推荐
最新文章