Using layer-list to display some drawable images

梦想与她 提交于 2019-12-02 18:57:07

Update your layer-list as follows

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

<item>
    <shape>
        <gradient
            android:centerX="0.5"
            android:centerY="0.1"
            android:endColor="#08e25b"
            android:gradientRadius="300dp"
            android:startColor="#b7e9c9"
            android:type="radial" />
    </shape>
</item>
<item
    android:width="48dp"
    android:height="48dp"
    android:bottom="68dp"
    android:right="-20dp">
    <bitmap
        android:gravity="bottom|right"
        android:src="@drawable/peas" />
</item>
<item
    android:height="68dp"
    android:left="-20dp"
    android:bottom="-20dp"
    android:width="68dp">
    <bitmap
        android:gravity="bottom|left"
        android:src="@drawable/peas" />
</item>

Akhil Jayakumar

Place your images in all density folders (xxhdpi, xhdpi, hdpi).

The system picks image resources based on screen resolution.

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