2

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??

  • What about the progress fill? What is your requirement for the progress? Should it be started from center always? – Shashika Dec 18 '13 at 06:23
  • there should be no progress fill, thumb should be at center always so that scrolling to left gives negative value and to right gives positive value –  Dec 18 '13 at 06:26
  • go through this link... http://stackoverflow.com/questions/17415096/seekbar-for-two-values-50-0-50/23324198#23324198 – suresh n Apr 27 '14 at 16:08

1 Answers1

2

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.

Shashika
  • 1,151
  • 1
  • 9
  • 21
  • how to remove progress fill till 50? –  Dec 18 '13 at 07:21
  • android:progressDrawable="@android:color/background_dark" should do it. You may use your own drawable instead of this. – Shashika Dec 18 '13 at 08:22
  • I want my minimum value to be 50 and maximum value to be 150. Setting maximum was straightforward but minimum is not setting whatsoever. Can you help me regarding that? Thanks! – Tushar Gogna Dec 17 '14 at 06:59
  • friend I want show -95 to +95.because the signal strength between this value.can you tell how to show this? – reegan29 Mar 26 '15 at 08:55