문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top