RecyclerView
の子としてRecyclerView
を使用していますが、2番目のRecyclerView
にデータを追加すると何も表示されません。私が第2の高さを設定したとき、それはその内容を示す(例えば100dp)と言うべきです。別のRecyclerViewの内部で使用すると、RecylerViewの高さが塗りつぶされない
どのように問題を解決する必要がありますか?
-main XML
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view1"
android:layout_margin="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progressBar3"
android:visibility="gone"
android:background="#1E88E5"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
項目のXML
<RelativeLayout android:clickable="true" android:id="@+id/lla2" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:text="Medium Text" android:id="@+id/textView3" android:layout_alignParentTop="true" android:layout_marginTop="@dimen/activity_horizontal_margin" android:layout_marginBottom="@dimen/activity_horizontal_margin" android:layout_alignRight="@+id/view13" android:layout_alignEnd="@+id/view13" android:layout_toEndOf="@+id/ib2" android:layout_alignLeft="@+id/view13" android:layout_alignStart="@+id/view13" android:layout_toRightOf="@+id/ib2" /> <View android:layout_width="match_parent" android:layout_height="1dp" android:background="@android:color/darker_gray" android:id="@+id/view13" android:layout_margin="@dimen/activity_horizontal_margin" android:layout_below="@+id/textView3" android:layout_toRightOf="@+id/ib2" android:layout_toEndOf="@+id/ib2" /> <android.support.v7.widget.RecyclerView android:id="@+id/recycler_view6" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="@dimen/activity_horizontal_margin" android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_marginBottom="@dimen/activity_horizontal_margin" android:layout_alignLeft="@+id/textView3" android:layout_alignStart="@+id/textView3" android:layout_below="@+id/view13" /> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="?selectableItemBackground" android:src="@drawable/ic_more_vert_black_24dp" android:alpha="0.5" android:id="@+id/ib2" android:layout_marginTop="@dimen/activity_horizontal_margin" android:layout_alignTop="@+id/textView3" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" /> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="?selectableItemBackground" android:src="@drawable/note" android:layout_marginTop="@dimen/activity_horizontal_margin" android:id="@+id/imageButton" android:alpha="0.1" android:layout_below="@+id/ib2" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" /> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="?selectableItemBackground" android:src="@drawable/bookmark" android:alpha="0.5" android:id="@+id/imageButton2" android:layout_below="@+id/imageButton" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" /> </RelativeLayout>
xmlを投稿してください。 –
@LucasPaolillo xmlを投稿しました – Ali