なしスクロール、私はシンプルなレイアウトを設計している:アンドロイド5.X(ロリポップ)のためRecyclerVivewで苦労RecyclerViewアンドロイドロリポップ5.xの
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:baselineAligned="false"
android:orientation="horizontal"
android:weightSum="4">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvAuditStartDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/to" />
<TextView
android:id="@+id/tvAuditEndDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvAuditDepartmentName"
style="@style/TextviewPrimaryMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:lines="1" />
<TextView
android:id="@+id/tvSubItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center" />
</LinearLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2">
<TextView
android:id="@+id/tvAuditSubmitDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</FrameLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5">
<CheckBox
android:id="@+id/chkbAuditStatus"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:background="@drawable/check_box"
android:button="@android:color/transparent"
android:clickable="false"
android:gravity="end" />
</FrameLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />
</LinearLayout>
とカスタムRecyclerView.Adapterはと、それに接続されますなどの項目のレイアウト:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical">
<LinearLayout
android:baselineAligned="false"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:orientation="horizontal"
android:weightSum="4">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvAuditStartDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/to" />
<TextView
android:id="@+id/tvAuditEndDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tvAuditDepartmentName"
style="@style/TextviewPrimaryMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:lines="1"/>
<TextView
android:id="@+id/tvSubItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center" />
</LinearLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.2">
<TextView
android:id="@+id/tvAuditSubmitDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</FrameLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5">
<CheckBox
android:id="@+id/chkbAuditStatus"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:background="@drawable/check_box"
android:button="@android:color/transparent"
android:clickable="false"
android:gravity="end" />
</FrameLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />
</LinearLayout>
は今、この設定で問題は、セットアップがRecyclerViewへのスクロールが生じないよう5.Xを除くすべてのアンドロイドのバージョンで正常に動作していますさ。また、スクロールが観察されていない唯一のケースではありませんが、スピナーのような他のビューでもスクロールが観察されない場合もあります。 Spinnersの場合、ドロップダウンリストが表示されますが、選択した項目がUIに反映されていません。 すべてのビューがフラグメント内で膨張します。
返信ありがとうございますが、私のためにはうまくいかず、基本的に私はあなたの要点を持っていませんでした。もし 'itemlayout'に' ScrollView'を追加すれば何が変わるのですか? – iSandeep
あなたのコードをよりよく理解するには、より良い解決策を提供できるようにあなたのコードを見ることができるようにメールIDを提供してください – yash786