Recently I have been working on an app which has a SeekBar
. The SeekBar
is rather thin so it can at times be difficult to use it (you have to be very precise in your gestures). Is there any way to increase the touchable area of the SeekBar
? So I want users to be able to touch above or below the SeekBar
to move the thumb. I'd appreciate any help you can offer!
Asked
Active
Viewed 8,596 times
20
1 Answers
47
One of the most straightforward approaches is to increase a value of the android:padding
attribute:
<SeekBar
android:id="@+id/yourSeekBar"
android:progressDrawable="@drawable/seekbar_progress"
android:thumb="@drawable/seekbar_thumb"
android:paddingTop="@dimen/your_topPadding"
android:paddingBottom="@dimen/your_bottomPadding" />
Another possibility: make a custom thumb and increase its background's size by adding e.g. transparent border.
In addition, there you have a nice tutorial describing a custom SeekBar
creation.

Scott Ferguson
- 7,690
- 7
- 41
- 64

mmBs
- 8,421
- 6
- 38
- 46
-
1Well that was easy! Adding the padding at the top and bottom worked like a charm! – Zero May 15 '13 at 07:52
-
2If the containing view is large enough, you can also set negative margins to compensate for the padding so it doesn't mess up your layout, assuming you don't have other touchable widgets in the enlarged area. – Tenfour04 Jul 09 '17 at 19:51