Phonegap滚动条

时间:2016-12-14 08:07:43

标签: cordova scrollbar phonegap-plugins

您好我正在尝试让滚动条显示在手机屏幕应用中,但它只是不会出现。我已经阅读了所有的主题。

在CSS样式表中设置它们。我已经读过你不能设置它们的帖子了吗?谢谢你的时间

scrollbar {
    -webkit-appearance: none;
   width: 10px !important;
}

::-webkit-scrollbar {
  width: 10px !important;

}
scrollbar:vertical {
   width: 5px !important;
}
::-webkit-scrollbar:vertical {
     width: 5px !important;
}
scrollbar:horizontal {
  height: 2px !important;
}
::-webkit-scrollbar:horizontal {
     height: 2px !important;
}

scrollbar-thumb {
    background-color:#42c0fb !important;
    border-radius: 5px !important;
     border: 2px solid blue; 
     background-color:blue;
}
::-webkit-scrollbar-thumb {
      background-color:#42c0fb !important;
    border-radius: 5px !important;

}
scrollbar-track {
   border-radius: 5px !important;
    background-color: white !important;
}
::-webkit-scrollbar-track {
   border-radius: 5px !important;
    background-color: white !important;
}

1 个答案:

答案 0 :(得分:1)

我能够通过使用仅在Android上应用的Webkit滚动条CSS来完成此任务。我使用

将android-scroll-bar类添加到Android上的页面

$('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); }

对于显示滚动条,您必须安装Cordova crosswalk插件。 对于PhoneGap,也可能有人行横道插件。