如何将此背景作为xml drawable?

时间:2015-11-26 22:54:16

标签: android background-image xml-drawable

我想给我的应用程序一个背景,我想在xml文件中创建它,而不是图像 有人能帮我吗?请。

background here

2 个答案:

答案 0 :(得分:1)

我明白了:

<item android:top="200px">
    <shape>
        <solid android:color="#FF954CFB" />
    </shape>
</item>

<item android:height="10dp">

    <shape>
        <solid android:color="@color/colorWhite" />
    </shape>
</item>
<item android:top="-500dp" android:bottom="300dp" android:left="-100dp" android:right="-100dp">
    <shape>
        <corners android:radius="400dp" />
        <solid android:color="@color/colorWhite" />
    </shape>
</item>

答案 1 :(得分:0)

我明白了!

XML文件:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:top="200px">
        <shape>
            <solid android:color="#6bcbf4" />
        </shape>
    </item>



    <item android:bottom="900px">
        <shape android:shape="oval">
            <solid android:color="#FFF8F8F8"
                />
        </shape>
    </item>



</layer-list>