Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android SeekBar thumb gets clipped/cut off

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?

like image 794
Jana Avatar asked May 26 '10 11:05

Jana


People also ask

How do I change the SeekBar thumb on Android?

Just add android:thumbTint="@color/yourColor" in your seekbar.

How do I manage SeekBar on Android?

A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys. Placing focusable widgets to the left or right of a SeekBar is discouraged.

How can I increase my SeekBar size?

Edit the maxHeight to your desired height what you want to achieve. It will work perfectly. Show activity on this post. You have to add some padding for all directions and also set the min and max height of the SeekBar.

How do I change the color of my SeekBar line in Android?

If you are using default SeekBar provided by android Sdk then their is a simple way to change the color of that . just go to color. xml inside /res/values/colors. xml and change the colorAccent.


1 Answers

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.

like image 50
Roman Nurik Avatar answered Sep 17 '22 11:09

Roman Nurik