Ich mache eine App, die eine RecyclerView mit einigen Elementen enthält. Die App verwendet eine BottomNavigationView und drei andere Fragmente, um Inhalte anzuzeigen. Nun enthält eines dieser Fragmente nur eine RecyclerView und scrollt nicht.RecyclerView scrollt nicht
Ich habe bereits einige Dinge versucht, wie die Höhe des RecyclerView von match_parent zu wrap_content zu ändern, es mit einem LinearLayout zu umhüllen, eine NestedScrollView oder reguläre ScrollView zu verwenden, app: layout_behavior und sogar android: scrollbars hinzuzufügen. Nichts hat funktioniert.
Die XML-Datei des Layouts mit der Liste, die in ihm ist Scrollen nicht:
<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>
ich die ConstrainedLayout gesetzt unten als Mutter des anderen Fragment, das auch die BottomNavigationView enthält (dies erzeugt wird von Android Studio, wenn ich das Projekt btw erstellt):
<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>
schließlich diese in das Fragment der Klasse ist, wo ich die RecyclerView gesetzt:
adapter = new UserListAdapter(list, getContext(), getLayoutInflater(), container);
RecyclerView recyclerView = v.findViewById(R.id.rv_users);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(adapter);
Ich hoffe einer von euch kann mir helfen!
Können Sie einen Screenshot? – diegoveloper
Es ist nur eine Recyclerview Liste, die nicht scrollt, nicht wirklich viel auf einem Screenshot zu sehen – AnotherBiscuit
Könnte 2 Dinge sein: 1: Es gibt nicht genug Daten zu blättern, 2: Es gibt eine Ansicht/Fragment vor der Recyclerview – diegoveloper