如何通过在导航抽屉中将刻度线从点替换为数字来实现离散搜索栏。有可能吗

How to implement seekbar discrete with replacing tick mark from dot to numbers in navigation drawer . Is it possible at all

<SeekBar
    android:id="@+id/seekBar2"
    style="@style/Widget.AppCompat.SeekBar.Discrete"
    android:layout_width="match_parent"
    android:layout_height="48dp"
    android:thumb="@drawable/ic_circle"
    android:max="7"
    android:progress="3"/>

https://i.stack.imgur.com/NBU9Z.jpg

如何通过在导航抽屉中将刻度线从点替换为数字来实现离散搜索栏。有可能吗

尝试使用值并使用枚举:

  public static final String VAL1 = "A8";
  public static final String VAL2 = "A1";
  public static final String VAL3 = "A5";
  public static final String VAL4 = "A1";

public static enum Suit {VAL1,VAL2,VAL3,VAL4}
    
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) 
{
     progressChangedValue = progress;
     setProgresValue(Suit(progressChangedValue));
}

或者使用 https://github.com/warkiz/IndicatorSeekBar

这样的库