I am trying to add the RecyclerView
inside the NestedScrollView
which is inside a constraint layout,but it not getting add up i.e. RecyclerView
is not showing up even after adding it up,please help me,I am adding the XML code of it.
what I am doing
Adding the
NestedScrollView
inside the constraint layout and adding theRecyclerView
below the linear layout which is within theNestedScrollView
.<layout xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.MainFragment"> <include android:id="@+id/toolbar" layout="@layout/toolbar_default_back" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <androidx.core.widget.NestedScrollView android:id="@+id/scrollview" android:layout_width="match_parent" android:layout_height="0dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" android:fillViewport="true" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/toolbar"> <LinearLayout android:id="@+id/linear_layout" android:layout_width="match_parent" android:layout_height="200dp" android:layout_marginStart="20dp" android:layout_marginTop="10dp" android:orientation="horizontal" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> <ImageView android:id="@+id/imageView13" android:layout_width="wrap_content" android:layout_height="45dp" app:srcCompat="@drawable/ic_baseline_person_add" tools:layout_editor_absoluteX="13dp" tools:layout_editor_absoluteY="14dp" /> <TextView android:id="@+id/textView42" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="10dp" android:layout_marginTop="8dp" android:layout_weight="1" android:text="Received" android:textSize="18sp" /> </LinearLayout> <androidx.recyclerview.widget.RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="450dp"> </androidx.recyclerview.widget.RecyclerView> </androidx.core.widget.NestedScrollView> </androidx.constraintlayout.widget.ConstraintLayout> </layout>