我怎样才能画出这个形状?
How can I draw this shape?
我画不出这个图像形状。我试过这个 xml 但它不一样。
我的xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#ffffff" />
<corners android:radius="70dp" />
</shape>
</item>
<item android:right="10dp">
<shape android:shape="rectangle">
<solid android:color="#ffffff" />
<corners android:radius="50dp" />
</shape>
</item>
</layer-list>
您可以分别定义每个角的半径,例如 ;
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffff" />
<corners
android:bottomLeftRadius="50dp"
android:bottomRightRadius="70dp"
android:topLeftRadius="50dp"
android:topRightRadius="70dp" />
</shape>
我画不出这个图像形状。我试过这个 xml 但它不一样。
我的xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#ffffff" />
<corners android:radius="70dp" />
</shape>
</item>
<item android:right="10dp">
<shape android:shape="rectangle">
<solid android:color="#ffffff" />
<corners android:radius="50dp" />
</shape>
</item>
</layer-list>
您可以分别定义每个角的半径,例如 ;
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffff" />
<corners
android:bottomLeftRadius="50dp"
android:bottomRightRadius="70dp"
android:topLeftRadius="50dp"
android:topRightRadius="70dp" />
</shape>