0

ビューホルダー アイテム内に recyclerview があり、最大 5 つの画像を他のテキストと共に適切に表示します。画像が非常に小さいことを除けば、かなりうまく機能しています。どこが間違っているのかわかりません。

メイン ビューホルダー アイテムのレイアウト

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:local="http://schemas.android.com/apk/res-auto"
              android:orientation="vertical"
              android:background="@color/white"
              android:layout_width="match_parent"
              android:layout_height="wrap_content">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingTop="14dp">
        <TextView
            android:id="@+id/feedItem_txtTitle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:paddingLeft="15dp"
            android:paddingRight="15dp"
            android:layout_marginTop="14dp"
            android:textColor="@color/dark_gray"/>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/feedItem_rvImageGrid"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:visibility="gone" />

        <View
            android:layout_marginTop="5dp"
            android:layout_width="match_parent"
            android:layout_height="15dp"
            android:background="@color/very_light_gray"/>
    </LinearLayout>
</LinearLayout>

画像グリッド ビューホルダー アイテム:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="vertical">
    <ImageView
        android:id="@+id/feedItemImage_ivImage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:scaleType="centerCrop" />
</LinearLayout>

グリッドをリサイクラービューにバインドするために使用しているコード

_layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.Vertical);
_feedItemImageAdapter = new FeedItemImageAdapter(_imageUrlsVisible, _imageUrlsFull);

_rvImageGrid.SetAdapter(_feedItemImageAdapter);
_rvImageGrid.SetLayoutManager(_layoutManager);

他に何が見たいかわからない場合は、さらにコード サンプルを提供する必要がある場合はお知らせください。何が間違っているのかわかりません。

4

1 に答える 1