View绘制(绘制渐变圆环)

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromDegrees="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toDegrees="360"

    >
    <shape
        android:innerRadiusRatio="3"
        android:shape="ring"
        android:thicknessRatio="10"
        android:useLevel="false"
        >
        <gradient
            android:centerColor="@android:color/holo_blue_dark"
            android:centerY="0.50"
            android:endColor="@android:color/holo_blue_dark"
            android:startColor="@android:color/darker_gray"
            android:type="sweep"
            android:useLevel="false"
            />
    </shape>

</rotate>

 

<ProgressBar
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:layout_centerInParent="true"
    style="?android:attr/progressBarStyleSmall"
    android:indeterminateDrawable="@drawable/loading_progress"/>

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页