<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rl" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="2dp" android:layout_marginRight="2dp" android:layout_marginTop="2dp"> <ImageView android:id="@+id/image" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:src="@mipmap/test" /> <ImageView android:visibility="gone" android:id="@+id/is_add_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:src="@mipmap/is_add_image" /> </RelativeLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="12dp" android:layout_marginBottom="2dp" android:layout_marginLeft="2dp" android:layout_marginRight="2dp" android:background="@color/context_bag"> <TextView android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:text="66" android:textColor="#ebeaed" android:textSize="10sp" /> </RelativeLayout> </LinearLayout> </LinearLayout>//最外层充满,其他都是自适应高度,GridView高度也充满
防止GridView或者recycleview item图片变形
最新推荐文章于 2021-12-16 22:19:11 发布