array(2) { ["docs"]=> array(0) { } ["count"]=> int(0) } 111string(0) "" int(1) int(10) int(70) int(8640000) array(2) { ["docs"]=> array(0) { } ["count"]=> int(0) } RecycleView在一页屏幕只显示一个Item - 爱码网

原因是在创建Item时将layout_height属性设成了match_parent,致使一个Item充满了一页屏幕,只要将此属性改为wrap_parent就可以了。

<LinearLayout xmlns:
    andro
    android:orientation="horizontal" 
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <ImageView
        android:
        android:layout_width="80dp"
        android:layout_height="80dp" />
    <TextView
        android:
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:gravity="center"/>
</LinearLayout>

 

相关文章: