Android SeekBar thumb gets clipped/cut off

Jana picture Jana · May 26, 2010 · Viewed 36.6k times · Source

When using a custom thumb drawable with a SeekBar view, the thumb drawable is clipped at the left and right edges of the view.

How can I fix this behavior?

Answer

Roman Nurik picture Roman Nurik · May 28, 2010

You should be able to fix this by setting paddingLeft and paddingRight on your SeekBar to half the thumb width (remember to use density-independent units). You can also control the space allowed at the edges for a seek bar's thumb by calling setThumbOffset.