【发布时间】:2018-01-11 20:10:49
【问题描述】:
【问题讨论】:
-
你用什么库来实现这个进度条?
-
@AhmedAlnabhan github.com/lzyzsd/CircleProgress 这个。
标签: android android-animation android-progressbar
【问题讨论】:
标签: android android-animation android-progressbar
如果您正在使用该库,请使用
<com.github.lzyzsd.circleprogress.ArcProgress
android:id="@+id/arc_progress"
android:background="#214193"
android:layout_marginLeft="50dp"
android:layout_width="100dp"
android:layout_height="100dp"
custom:arc_progress="55"
custom:arc_bottom_text="Required Text"/>
【讨论】:
<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="12.0"
android:useLevel="false">
<bitmap android:src="@drawable/bg" />
</shape>
</item>
<item android:id="@android:id/progress">
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="12.0">
<gradient
android:endColor="#cc44b9ff"
android:startColor="#cc9730ff"
android:type="linear" />
</shape>
</item>
Layer List 是一种可绘制的类型,第一项表示背景,第二项表示进度条应该如何。
注意:第二个项目的ID应该是android:id="@android:id/progress",如果你想要纯色可以去掉渐变。
【讨论】: