移動開發---修改圓形progressBar顏色

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fillAfter="true"
    android:fromDegrees="0"
    android:interpolator="@android:anim/linear_interpolator"
    android:pivotX="50%"
    android:pivotY="50%"
    android:repeatCount="infinite"
    android:repeatMode="restart"
    android:toDegrees="359">
    <shape
        android:shape="ring"
        android:innerRadiusRatio="3"
        android:useLevel="false"
        android:thicknessRatio="7">
        <gradient
            android:type="sweep"
            android:useLevel="false"
            android:startColor="#F6F000"
            android:centerY="0.50"
            android:endColor="#6B63FF" />
    </shape>
</rotate>

drawable文件夾下命名xxxx.xml

佈局中直接引用

<ProgressBar
            android:indeterminateDrawable="@drawable/progressbar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true" />

效果圖:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章