user2861651
user2861651

Reputation:

SeekBar thumb at the middle of progress not at the starting point

How can I center the thumb of SeekBar so that If I scroll left it gives negative value and if I scroll right it gives me positive value??

Upvotes: 2

Views: 2826

Answers (1)

Shashika
Shashika

Reputation: 1161

Hope this would help.

<SeekBar
        android:id="@+id/seekBar1"
        android:progressDrawable="@android:color/background_dark"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:progress="50"
        android:max="100" />

And use int progress = mSeekBar1.getProgress()-50; to get the progress.

Upvotes: 2

Related Questions