PhoneGap的3.0 - 安卓原生滚动条不可见 [英] Phonegap 3.0 - Android: Native Scrollbar Not Visible

查看:147
本文介绍了PhoneGap的3.0 - 安卓原生滚动条不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前来自第三方的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的Andr​​oid可见的滚动条?

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); }

这篇关于PhoneGap的3.0 - 安卓原生滚动条不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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