android 如何实现搜索栏离散化,将导航抽屉中的勾号从点改为数字,有没有可能

7y4bm7vi  于 2023-06-28  发布在  Android
关注(0)|答案(1)|浏览(70)
<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
如何实现搜索栏离散化,将导航抽屉中的勾号从点改为数字。有没有可能。

lymnna71

lymnna711#

使用值并使用枚举:

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这样的库

相关问题