0
如何創建一個弧形的進度條動畫與恆定的圖像裏面它像這樣弧進度條具有恆定的圖像內
如何創建一個弧形的進度條動畫與恆定的圖像裏面它像這樣弧進度條具有恆定的圖像內
<?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>
層列表是一種可繪製的第一個項目代表背景和第二項表示進度條應該如何。
注意:第二項的ID應該是android:id="@android:id/progress"
,如果你想變成純色,你可以去掉漸變。
如果您使用的是庫,然後您使用實現這個進度條什麼庫使用
<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"/>
? –
@AhmedAlnabhan https://github.com/lzyzsd/CircleProgress這一個。 –