1

私はいくつかの項目を含むrecyclerViewを含むアプリケーションを作っています。このアプリはBottomNavigationViewと他の3つの断片を使用してコンテンツを表示します。 これらのフラグメントの1つにRecyclerViewだけが含まれていて、スクロールしていません。RecyclerViewがスクロールしていません

RecyclerViewの高さをmatch_parentからwrap_contentに変更したり、NestedScrollViewや通常のScrollViewを使用してLinearLayoutでラップしたり、app:layout_behavior、さらにはandroid:scrollbarsを追加するなど、いくつかのことを既に試みました。何もうまくいかなかった。

それにスクロールされていないリストとレイアウトのXMLファイル:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_marginBottom="55dp"> 

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/rv_users" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"/> 

</FrameLayout> 

私は他の断片の親としての下ConstrainedLayoutを設定し、これはまたBottomNavigationViewが含まれています(これが生成されます)私はところでプロジェクトを作成したときのAndroidメーカーによって:

<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:id="@+id/main_container" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

    <android.support.design.widget.BottomNavigationView 
     android:id="@+id/navigation" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_marginEnd="0dp" 
     android:layout_marginStart="0dp" 
     android:background="@color/colorPrimary" 
     app:itemIconTint="@drawable/bottom_nav_selector" 
     app:itemTextColor="@drawable/bottom_nav_selector" 
     app:layout_constraintBottom_toBottomOf="parent" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintRight_toRightOf="parent" 
     app:menu="@menu/navigation" /> 

</android.support.constraint.ConstraintLayout> 

最後に、これは私がRecyclerViewを設定するフラグメントのクラス、内部にある:

adapter = new UserListAdapter(list, getContext(), getLayoutInflater(), container); 
    RecyclerView recyclerView = v.findViewById(R.id.rv_users); 
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); 

    recyclerView.setAdapter(adapter); 

皆さんのお役に立てれば幸いです。

+0

スクリーンショットを付けてもらえますか? – diegoveloper

+0

これは、スクロールしないリサイクルビューのリストです。スクリーンショットではあまり表示されません。 – AnotherBiscuit

+0

2つあります。1:スクロールするにはデータがありません.2:recyclerviewの前にビュー/フラグメントが1つあります。 – diegoveloper

答えて

-1

スクロール用のリサイクラーのリストには十分なデータがありますか?

+1

これは質問なので、答えよりも質問にコメントとして残したほうがよいでしょう... – Submersed

+1

はい、アダプターに送信するリストは正しいデータで埋められています – AnotherBiscuit

関連する問題