0
現在我正在使用一個簡單的RecyclerView應該顯示在TextView下。但是,當我用更多的項目填充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」? –
然後它繪製了我的textView。問題仍然存在。我已經多次嘗試過 – Nephilim
您是否爲recyclerView設置了LayoutManager? –