Seek bar, change path color from yellow to white

Viewed 96077

I have two questions:

1) how do I change the color of the seek bar (path) from yellow (the default color) to white. What I mean to say is, while I slide the thumb , it turns the line traversed from grey to yellow. I want track/line to either remain grey or white..Basically I want just the thumb to move with no color change in the seek bar.

2) How to change the thumb of seekbar from rectangle to circle/sphere/round shape.

any pointers will be appreciated.

7 Answers

1. Create a drawable XML: Name it : progress_drawable

<?xml version="1.0" encoding="UTF-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"
  android:shape="line">

<stroke android:width="1dp" android:color="#fff"/>

</shape>

2. Assign it to Seekbar

            <SeekBar
                    android:id="@+id/slider_1"
                    android:progressDrawable="@drawable/progress_drawable"
                    android:layout_width="180dp"
                    android:layout_height="32dp"
                    android:layout_gravity="center"
                    android:rotation="270" />
Related