user2959805
user2959805

Reputation: 47

Android: fade scroll bar colour and width

Good morning; I have a list view in ANDROID where I want that the fadScroll bare appears event it is not cliked, after doing many research I found that I must add in XML the following line:

android:fadeScrollbars="false"

Yes it was well, it appears , but the problem I want to change its width and colour.. is it possible using simple XML code ??

Thanks in advance

Upvotes: 1

Views: 1088

Answers (2)

Mr Nice
Mr Nice

Reputation: 524

yes it is possible. Create a scroll bar in drawable(scrollbar.xml) using this

<gradient
    android:angle="45"
    android:centerColor="#669C79E7"
    android:endColor="#66C0C0C0"
    android:startColor="#669C70E2" />

<corners android:radius="8dp" />

and add this scroll bar like android:scrollbarThumbVertical="@drawable/scrollbar" to your ListView

Upvotes: 1

Adhikari Bishwash
Adhikari Bishwash

Reputation: 2780

<ListView android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb" />

in the Drawable:

<shape xmlns:android="http://schemas.android.com/apk/res/android" > 
    <gradient android:angle="0" android:endColor="#6699FF" android:startColor="#3333FF" /> <corners android:radius="1dp" /> 
<size android:width="1dp" /> 
</shape>

Upvotes: 0

Related Questions