俗话说设计虐我千百遍 我对设计如初恋呀 有啥需求那就要 满足 满足 满足~
需求:
红圈圈的地方是个货架 本来是想着做到大背景图上 但滚动的时候货架的位置比较尴尬 所以就准备把他做到item的背景上
废话不多说直接上代码:这是item的布局
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/rl_product_item" android:layout_width="match_parent" android:layout_height="350dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingBottom="12dp" android:background="@drawable/item_background"//关键代码 android:gravity="center" android:orientation="vertical">
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/toolbar_bg_bmp" android:src="@mipmap/icon_product_storage" android:tileMode="disabled" android:gravity="bottom" > </bitmap>