Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在自定义样式中将滚动条可见性设置为true_Android_Android Layout - Fatal编程技术网

Android 如何在自定义样式中将滚动条可见性设置为true

Android 如何在自定义样式中将滚动条可见性设置为true,android,android-layout,Android,Android Layout,这就是我设置滚动条的方式。我在我的列表视图中插入此属性 android:scrollbarThumbVertical="@drawable/scroll_style_custom" 然后在我的绘图工具中使用custom\u scrollbar\u style.xml自定义滚动条 或者这只能通过在列表视图中设置另一个属性来实现吗?到目前为止,最好的方法是在xml中使用android:fadeScrollbars=“false”,这相当于ScrollView.setScrollbarFadin

这就是我设置滚动条的方式。我在我的
列表视图中插入此属性

android:scrollbarThumbVertical="@drawable/scroll_style_custom"
然后在我的绘图工具中使用
custom\u scrollbar\u style.xml
自定义滚动条


或者这只能通过在列表视图中设置另一个属性来实现吗?

到目前为止,最好的方法是在xml中使用
android:fadeScrollbars=“false”
,这相当于
ScrollView.setScrollbarFadingEnabled(false)在java代码中

如果两者都不起作用,您可以使用android:scrollbarFadeDuration=“0”


希望有帮助

你能发布你想要的图片吗?除非我滚动列表或使用
listView,否则滚动条不可见。setFastScrollAlwaysVisible(true)
我认为这只可能在列表视图中设置属性,或者使用Java。您是否尝试过将
android:scrollbars=“vertical”
添加到您的xml代码中,并告诉我是否有效,那么
listView.setFastScrollwaysVisible的区别是什么(true)?我明白了。那么快速卷轴只是标准卷轴的一个更快的版本?
<gradient
    android:angle="45"
    android:endColor="#FF3401"
    android:centerColor="#ff5c33"
    android:startColor="#FF3401" />

<corners android:radius="8dp" />
<size android:width="20dp"/>
<padding
    android:left="0.5dp"
    android:right="0.5dp" />
listView.setFastScrollAlwaysVisible(true);