How to hide/show thumb drawable in a SeekBar

Viewed 24372

I have a SeekBar with a custom drawable for the Thumb, and I would like to be able to show/hide it based on another control I have.

I have tried loading the drawable from resources, and then using SeekBar.setThumb() with the drawable, or null.

That hides it (the set to null), but I can never get it back.

4 Answers

The easiest & simplest way to do it is just add this line in your Seekbar view in its xml

android:thumb="@android:color/transparent"
Related