2017-07-01 15 views
0

今、私はTextViewの下に表示されるはずの単純なRecyclerViewを使用しています。しかし、私がRecyclerViewに多くのアイテムを取り込むと、それが途切れてスクロールしなくなります。私がRecyclerViewsから覚えていることは、スクロールするときに基本的に行ったすべての実装がそのまま機能していることです。多くのアイテムがある場合、RecyclerViewは一番下にスクロールしません。

<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout 
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_width="match_parent" 
android:layout_height="match_parent" 
app:layout_behavior="@string/appbar_scrolling_view_behavior" 
tools:context="david.projectclouds.MainActivity" 
tools:showIn="@layout/app_bar_main"> 


<TextView 
    android:id="@+id/Date" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:paddingBottom="@dimen/_20sdp" 
    android:paddingLeft="@dimen/_20sdp" 
    android:paddingTop="@dimen/_20sdp" 
    android:textAllCaps="true" 
    android:textColorLink="@color/colorAccent" 
    android:textSize="30sp" 
    android:typeface="sans" 
/> 

<android.support.v7.widget.RecyclerView 
    android:id="@+id/recycler_view" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    app:layout_constraintTop_toBottomOf="@+id/Date" 

    android:scrollbars="vertical" 
/> 
</android.support.constraint.ConstraintLayout> 

これは私の現在の主な活動XMLです。コードを追加する必要があるかどうか教えてください。 layout_heightは= "wrap_contentは" あるべき "match_parent":

+0

アンドロイドを使用するには? –

+0

それは私のtextViewを描画します。そして問題は依然として続く。 Iveはこれを複数回試しました – Nephilim

+0

recyclerViewのLayoutManagerを設定しましたか? –

答えて

2

てみ制約

<android.support.v7.widget.RecyclerView 
    android:id="@+id/recycler_view" 
    android:layout_width="0dp" 
    android:layout_height="0dp" 
    android:layout_marginBottom="8dp" 
    android:layout_marginLeft="8dp" 
    android:layout_marginRight="8dp" 
    android:layout_marginTop="8dp" 
    app:layout_constraintBottom_toBottomOf="parent" 
    app:layout_constraintLeft_toLeftOf="parent" 
    app:layout_constraintRight_toRightOf="parent" 
    app:layout_constraintTop_toBottomOf="@+id/Date" 
    android:layout_marginStart="8dp" 
    android:layout_marginEnd="8dp" /> 
+0

私はRelativeLayoutを使用することに決めましたが、ありがとうございます。 – Nephilim

関連する問題