Reputation: 8985
This is how I set up my scroll bar. I insert this attribute in my listView
.
android:scrollbarThumbVertical="@drawable/scroll_style_custom"
Then I customize the scrollbar with a custom_scrollbar_style.xml
in my drawables
<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" />
Now how do I set scroll bar visibility to true with my xml file?
Basically I want the equivalent of this but with a custom style
listView.setFastScrollAlwaysVisible(true);
Or is this only possible by setting another attribute in the list view?
Upvotes: 1
Views: 463
Reputation: 19361
As of now the best way is to use android:fadeScrollbars="false"
in xml which is equivalent to ScrollView.setScrollbarFadingEnabled(false);
in java code.
If both of them doesn't work, you can instead of them use android:scrollbarFadeDuration="0"
Hope it help
Upvotes: 1