試試這個使用下面的代碼,你可以畫出4圈
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
>
<!-- Larger blue circle in back -->
<item
>
<shape android:shape="oval">
<solid android:color="#00f"/>
<size
android:width="30dp"
android:height="30dp"/>
</shape>
</item>
<!-- Smaller red circle in front -->
<item
>
<shape android:shape="oval">
<!-- transparent stroke = larger_circle_size - smaller_circle_size -->
<stroke android:color="@android:color/transparent"
android:width="5dp"/>
<solid android:color="#f00"/>
<size
android:width="25dp"
android:height="25dp"/>
</shape>
</item>
<item android:top="2dp"
android:right="2dp"
android:bottom="2dp"
android:left="2dp"
>
<shape android:shape="oval">
<!-- transparent stroke = larger_circle_size - smaller_circle_size -->
<stroke android:color="@android:color/transparent"
android:width="5dp"/>
<solid android:color="#f000"/>
<size
android:width="20dp"
android:height="20dp"/>
</shape>
</item>
<item
android:top="5dp"
android:right="5dp"
android:bottom="5dp"
android:left="5dp"
>
<shape android:shape="oval">
<!-- transparent stroke = larger_circle_size - smaller_circle_size -->
<stroke android:color="@android:color/transparent"
android:width="5dp"/>
<solid android:color="#fff0"/>
<size
android:width="20dp"
android:height="20dp"/>
</shape>
</item>
我認爲你需要使用層,也許這將有助於[瞭解Android的(https://stackoverflow.com/questions/14436641/understanding-androids-layer-list) –
MikeT