How can I recreate this background in xml?

寵の児 提交于 2019-11-27 23:10:52

Try this

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle" />
    </item>
    <item
        android:bottom="300dp"
        android:left="-100dp"
        android:right="-100dp"
        android:top="-80dp">
        <shape android:shape="oval">
            <size android:height="20dp" />
            <gradient
                android:angle="0"
                android:centerColor="@color/colorAccent"
                android:endColor="@color/red"
                android:startColor="@color/colorPrimary"
                android:type="linear" />
        </shape>
    </item>
</layer-list>

OUTPUT

Try this

    <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item>
          <shape android:shape="rectangle" >
        <solid android:color="#ffffff"/>
    </shape>
 </item> <item
        android:bottom="400dp"
        android:left="-200dp"
        android:right="-200dp"
        android:top="-100dp">
        <shape android:shape="oval">
            <size android:height="20dp" />
            <gradient
                android:type="linear"
                android:startColor="#FD4F33"
                android:centerColor="#EE3A53"
                android:endColor="#DF2772"
                android:angle="0" />
        </shape> </item> </layer-list>

The background will be like this

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!