recyclerView内のレイアウトの割合が画面に表示される方法がありますか。RecyclerView内のレイアウトが画面上に表示される割合
RecyclerView内で膨張レイアウトが
android:layout_width="match_parent" android:layout_height="match_parent"
のparamsが編集レイアウトファイル
レイアウトファイルを追加しました - custom_card.xml
<?xml version="1.0" encoding="utf-8"?
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/card"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@id/imageView"
android:layout_alignTop="@id/imageView"
android:scaleType="fitCenter"
android:src="@drawable/image_view_screen" />
</RelativeLayout>
活動のレイアウトファイルを。
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:visibility="gone"
android:layout_width="56dp"
android:layout_height="56dp"
android:id="@+id/progress_bar"
android:layout_centerInParent="true"/>
</RelativeLayout>
は、私はそれを考え出した垂直LinearLayoutManager
あなたのレイアウトの幅を取得し、ここでは高さを使用する例 –
ためrecyclerViewの幅と比較することができます。レイアウトの高さは、画面上に表示される部分ではなく、元の寸法になります。 – Harshit
それから私たちに何かを見せてください。スクリーンショット?レイアウトファイル? –