如何在Android中以矩形形状制作弯曲边缘

时间:2020-01-13 10:59:44

标签: android android-layout android-xml

我试图在不使用图像作为背景的情况下实现这一目标,希望在xlm drawable中完成

Here is image of what am trying to achieve

1 个答案:

答案 0 :(得分:1)

使用此

<layer-list  xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
        <solid android:color="#FFFFFF" />
    </shape>
</item>
<item
    android:bottom="0dp"
    android:left="-200dp"
    android:right="-200dp"
    android:top="-340dp">
    <shape
        android:shape="oval">

        <solid android:color="@color/dark_orange" />
    </shape>
</item>

根据您的要求更改左右边距。那会改变曲线。enter image description here

相关问题