1
我想知道是否有RecycleView行的最大高度。我创建了一个简单的RecycleView.Adapter,其行布局不适合。它被切碎并开始新行。我不会在任何地方使用固定的高度或宽度,所以它应该像布局所需的那样扩展,除非在RecycleView中有最大的行高度?我将能够稍后发布一些代码。回收视图行最大高度?
为了讨论的方便,我只保留了这段代码膨胀(因为你可以看到用于测试目的,我设置的android:layout_height =“100000dp”):
<RelativeLayout
android:id="@+id/feed_photo_user_container"
android:layout_width="match_parent"
android:layout_height="100000dp"
android:background="@color/WHITE">
<com.github.siyamed.shapeimageview.CircularImageView
android:id="@+id/feed_photo_user_image"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="15dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:src="@drawable/user_icon" />
<TextView
android:id="@+id/feed_photo_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/feed_photo_user_image"
android:layout_alignTop="@id/feed_photo_user_image"
android:layout_marginLeft="8dp"
android:layout_toEndOf="@id/feed_photo_user_image"
android:layout_toRightOf="@id/feed_photo_user_image"
android:gravity="center"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:scaleType="fitXY"
android:src="@drawable/seperator_line" />
</RelativeLayout>
,结果是一样的, RecycleView以某种方式限制了我的行高。 正如你可以看到它可以扩大至一些最大高度
我真的不认为recyclerview的最大高度,你应该分享你的单一布局代码,你打算膨胀在RecyclerView.Adapter内 – KudzieChase
请分享你的布局xml和适配器代码 – Kushan
编辑,请检查 – sanevys