如何簡單的自定義圓形progressBar

2018-03-01 11:20:04來源:oschina作者:晨的暖陽人點擊

分享

定義res/drawable/progress_green.xml <?xml version="1.0" encoding="utf-8"?>
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="360">
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="15"
android:useLevel="false">
android:centerY="0.50"
android:endColor="@color/light_green"
android:startColor="@color/white"
android:type="linear"
android:useLevel="false"/>


2.為ProgressBar的indeterminateDrawable指定屬性.


android:id="@+id/loading_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateDrawable="@drawable/progress_green"
>

3.效果


微信掃一掃

第七城市微信公眾平臺
捕鱼达人小游戏