Android RecylcerView GridLayoutManager,其中视图跨越所有空间

Android RecylcerView GridLayoutManager,其中视图跨越所有空间,android,android-recyclerview,gridlayoutmanager,Android,Android Recyclerview,Gridlayoutmanager,我正在将GridLayoutManager与RecylcerView一起使用,它有两列 每个视图都有以下内容: <LinearLayout android:width="wrap_content" android:height="wrap_content"> <Imageview android:width="100dp" android:height="150dp" /> </Linearlayo

我正在将
GridLayoutManager
RecylcerView
一起使用,它有两列

每个视图都有以下内容:

<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>

尝试对XML文件使用以下代码:

<LinearLayout 
   android:width="match_parent"
   android:height="wrap_content">
   <Imageview
     android:width="match_parent" 
     android:height="wrap_content"/>
</Linearlayout>


它不起作用,当一行似乎接管时,没有显示任何内容。它不起作用,当一行似乎接管时,没有显示任何内容