android:scrollbarThumbVertical - Set the Color of the Thumb in a Vertical Scrollbar in TextView

How to Set the Color of the Thumb in a Vertical Scrollbar in TextView 

android:scrollbarThumbVertical was added in API Level 1

android:scrollbarThumbVertical: Defines the vertical scrollbar thumb drawable. This allows you to set the shape, color, size, and many other items.

1. Create an Android project, if you don't already have one.

2. Add a Vertical Scrollbar to your TextView.

3. Add a Shape Drawable file named thumb01.xml, with the solid color as #FF0000. (This will be red.)

4. In the main.xml file, add the code below.

  <TextView
        ...
        android:scrollbarThumbHorizontal = "@drawable/thumb01"
  />

5. Compile and run!

Related Articles:


Resources: