如何在xml android中绘制四分之一圆

Mos*_*lah 2 java xml android draw

我想画一个像这样的四分之一圈. android xml drawable

是否有任何方法可以像使用xml形状一样做这个形状?

小智 21

您可以使用下面的矩形形状.xml文件

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <size android:height="15dp" android:width="15dp"/>
    <solid android:color="@color/darkGray"/>
    <corners android:topRightRadius="0dp" android:bottomRightRadius="15dp"/>
</shape>
Run Code Online (Sandbox Code Playgroud)