我正在使用SeekArc library这是Android的循环搜索。我有xml,在里面我可以设置SeekBar的最大值(寻找弧:max =" 150")。但我想动态更改它,如果我做SeekBar.setMax不起作用。还有其他可能动态更改最大值吗?这是我的代码。
谢谢
<com.triggertrap.seekarc.SeekArc
android:id="@+id/seekArc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="30dp"
seekarc:arcColor="#C0C0C0"
seekarc:clockwise="true"
seekarc:max="150"
seekarc:progressColor="@color/red"
seekarc:rotation="180"
seekarc:startAngle="30"
seekarc:sweepAngle="300"
seekarc:thumb="@drawable/custom_seek_arc_control_selector"
seekarc:touchInside="true" />
答案 0 :(得分:1)
It doesn't looks like the library has a way to dynamically set the maximum value,但您可以轻松修改SeekArc
类以包含一个。甚至可以分叉并提交拉取请求。
public void setMax(int max) {
mMax = max;
invalidate();
}