android:scrollbarThumbHorizontal - Set Color of the Thumb in a Horizontal Scrollbar in TextView

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

added in API Level 1

Defines the horizontal 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.


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.

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

5. Compile and run!

Related Articles:


Resources: