imageView显示叠加图:背景是绿色,中间为add图标
<ImageView
android:id="@+id/iv_add_food"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_below="@+id/iv_filter"
android:layout_marginTop="10dp"
android:padding="16dp"
android:src="@drawable/layout_food_add_icon"/>
layout_food_add_icon.xml:叠加两个drawable;针对ic_add_food设置外边距
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/round_rect_r48_00aaa6" />
<item android:drawable="@drawable/ic_add_food" android:start="7dp" android:end="7dp" android:top="7dp" android:bottom="7dp"/>
</layer-list>
round_rect_r48_00aaa6.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_00aaa6"/>
<corners android:radius="48dp"/>
</shape>