我使用GridLayoutManager
与RecylcerView
,它有2列。
每个视图都有以下内容:
<LinearLayout
android:width="wrap_content"
android:height="wrap_content">
<Imageview
android:width="100dp"
android:height="150dp" />
</Linearlayout>
显然,每个图像都有分配的大小,这导致列之间的大的分离我需要做什么才能使图像视图占用所有可用区域?
尝试将以下代码用于XML文件:
<LinearLayout
android:width="match_parent"
android:height="wrap_content">
<Imageview
android:width="match_parent"
android:height="wrap_content"/>
</Linearlayout>