我创建了自定义进度栏:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="ring"
android:innerRadiusRatio="3"
android:thickness="10dp"
android:useLevel="false">
<solid android:color="@color/lightGrey" />
</shape>
</item>
<item>
<rotate
android:fromDegrees="270"
android:toDegrees="270">
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thickness="10dp"
android:useLevel="false">
<gradient
android:angle="0"
android:startColor="@color/grey"
android:endColor="@color/red"
android:type="sweep"
android:useLevel="false" />
</shape>
</rotate>
</item>
所以结果是:
但我想将其分为以下部分:
如何使用xml或使用画布进行绘制?我必须将部分放在特定的位置