android - 如何在android中实现带有单位增加的虚线进度条
问题描述
我想要这种类型的视图,我检查了 Discrete Seekbar,但它显示了每个步骤的点,即使 Thumb 和 Track 已更改。
如果我使用带有自定义 Thumb 和 Progress Drawable 的 Seekbar,我无法在使用 ProgressDrawable 附加的虚线上正确设置 Progress,以及如何限制用户拖动 Seekbar。
<!-- dotted.xml -->
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android1="http://schemas.android.com/apk/res/android">
<!--Item background and progress order cannot be reversed-->
<item android:id= "@android:id/background" >
<shape android:shape= "line" >
<stroke
android:width= "10dp"
android:color= "#E9EAF5"
android:dashWidth="10dp" android:dashGap="4dp"/>
</shape>
</item>
</layer-list>
<SeekBar
android:id="@+id/seekBar"
android:layout_width="181dp"
android:layout_height="48dp"
android:enabled="false"
android:progress="6"
android:progressDrawable="@drawable/dotted"
android:thumb="@drawable/circle_progress" />
解决方案
推荐阅读
- angular - 在 ngAfterInit 中设置 nativeElement.style.color 在 Angular 中不起作用
- php - 如何在 PHP 中一次定义多个具有不同值的变量?
- php - 让 if 语句了解哪种“剩余时间”格式更大
- objective-c - 自定义 UITableViewCell + Objective-C
- spring-boot - Adobe Reader 无法从我的项目中读取字体?
- kubernetes-helm - Helm 升级失败并出现错误:需要 " 或 n,但发现 t
- testing - 拆分一个大测试来耦合柏树中的文件
- tsql - 在 TSQL 中组合查询
- reactjs - 如何将节点与 highcharts 对齐
- bitbucket - 如何识别bitbucket的不同文件夹中是否存在相同的组件?