Discrete SeekBar

前端 未结 2 2008
眼角桃花
眼角桃花 2021-01-11 16:02

I am trying to create a discrete seek bar for an Android app.

I know I can set max and min values for a SeekBar (my ideal solution would be the

相关标签:
2条回答
  • 2021-01-11 16:15

    Check this link If you want to implement discrete seekbar with number of gaps without using third party library then use style property of seekbar.

    <SeekBar
         android:id="@+id/sb"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:max="10"
         android:thumb="@drawable/ic_location"
         android:theme="@style/Widget.AppCompat.SeekBar.Discrete" />
    

    0 讨论(0)
  • 2021-01-11 16:34

    The Android SeekBar cannot set intervals, but you can set the maximum value to 10 so that the range is [0, 10], and whenever you want to get a value from it, multiply the SeekBar's value by 10, so you can "simulate" having intervals of 0, 10, 20, 30, ...

    0 讨论(0)
提交回复
热议问题