ConstraintLayout
の中にRecyclerView
があります。私のScrollViewの下部に大きい空白領域が表示されています
構造はこのようなものです:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:fillViewport="true"
android:overScrollMode="never">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/my_list"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginBottom="8dp"
android:layout_marginTop="15dp"
android:clipToPadding="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="parent"
app:layout_constraintVertical_bias="0.0" />
</android.support.constraint.ConstraintLayout>
</ScrollView>
私のコードはRecyclerView、そこに何の問題へのオブジェクトのリストを作成します。唯一の問題は、ScrollView
の下部に大きな空白領域が表示されていることです。理由を理解できません。誰かが私を正しい方向に向けることができますか?前もって感謝します!
(たとえば、リストにオブジェクトが1つしかない場合、ビューをスクロールする必要はありませんが、下部の大きな空白領域をスクロールすることができます)
あなたは、対応する要素とのコードスニペットを更新してくださいもらえますか?またはですか? –
Leem
更新された回答、確認してください、追加の説明もあります。 – elmorabea
いいえ、これにより、全体のビューはスクロールできません。私はmatch_parentの代わりにRecyclerViewのwrap_contentを使って問題を解決しました。 – Leem