1

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

user2959805
  • 47
  • 1
  • 7
  • This similar to your question: http://stackoverflow.com/questions/2640877/how-to-set-the-color-of-an-android-scrollview-fading-edge and http://stackoverflow.com/questions/4678051/controlling-the-color-of-the-fading-edge-in-listviews – Alexander.Shtanko Dec 23 '13 at 09:11
  • Just write in xml properties: `android:scrollbarThumbVertical="@android:color/darker_gray" android:scrollbarSize="5dp"` – i_tanova Jan 04 '19 at 10:41

2 Answers2

1

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

Mr Nice
  • 524
  • 8
  • 24
  • tell me please where to create it exactly ? under which file and using what type of files? thanks. – user2959805 Dec 23 '13 at 09:22
  • in drawable folder create a file scrollbar.xml using the given code and include that in your layout file(Listview or grid view) like android:scrollbarThumbVertical="@drawable/scrollbar – Mr Nice Dec 23 '13 at 09:24
  • I am trying please wait for me because I cant see any difference – user2959805 Dec 23 '13 at 09:35
  • where you create your scrollbar.xml file – Mr Nice Dec 23 '13 at 09:47
  • ok ok sorry because I had three layout (small , large, xlarge) I was modifying the small and testing using the large, I am sorry and thank you very much for your great answer, it was really helpufl except that i think it contains some error because I used your explanation with the followin previous code – user2959805 Dec 23 '13 at 09:51
  • Thanks.create drawable folder in res it will be accessable to all screen. – Mr Nice Dec 23 '13 at 09:56
0
<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>
Adhikari Bishwash
  • 2,770
  • 28
  • 32
  • Could you explain me please where is situated the DRAWABLE ?? because I have a file that is called drawable and it contains pictures..( drwable-hdpi; ldpi...ext) – user2959805 Dec 23 '13 at 09:19