Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Android SeekBar track start position?

I'd like to set the SeekBars's track start position so it does not start from the left side of the seekbar, but form an arbitrary position. Here is a photoshop image how it should look like:

http://i.imgur.com/QCMEu.png

It should be just a graphical effect, the SeekBar's underlying logic is not changed.

I tried to change the Seekbar.getprogressDrawable.SetBounds() to change the track image position, but no luck.

like image 282
user1000594 Avatar asked Oct 18 '11 09:10

user1000594


1 Answers

You can set progress of SeekBar in xml as:

android:progress="10"
android:max="90" <!-- maximum seekbar progress -->

you can programmatically set the progress of SeekBar as:

seekBar.setProgress(10);
like image 174
Hiral Vadodaria Avatar answered Sep 24 '22 17:09

Hiral Vadodaria