【发布时间】:2018-10-02 09:32:37
【问题描述】:
我想制作这个形状,因为我尝试使用 layer-list 来设计这种形状,但它并没有完全按照我想要的方式发生。
<?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="@color/APP_PRIMARY"/>
<corners android:topRightRadius="100dp"
android:bottomRightRadius="100dp"/>
</shape>
</item>
<item android:width="100dp" >
<shape android:shape="rectangle">
<solid android:color="@color/white"/>
<corners android:topRightRadius="90dp"
android:bottomRightRadius="90dp"/>
</shape>
</item>
</layer-list>
以上代码的输出是
所需的输出。
【问题讨论】:
-
使用Path制作自定义视图。
-
去自定义视图
标签: java android xml drawable android-drawable