'How to reduce gap between 2 different items of a recyclerView?
See this gap between the textViews of different items
There is a lot of spacing between the 2 different items in my recyclerView....Here is my xml Code...When I add every element like recycler View and textView and progressBar in a Linear layout then everything sticks to left top of the screen....please help
`enter code here`
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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"
android:background="#D500F9"
tools:context=".Dogs_Diseases">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
`android:layout_width="414dp"
android:layout_height="652dp"
android:background="#FBF7F7"
android:elevation="?android:attr/scrollbarSize"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="@+id/textView2"
android:layout_width="219dp"
android:layout_height="76dp"
android:shadowColor="#D14141"
android:text="Dogs"
android:textAlignment="center"
android:textColor="#00E5FF"
android:textSize="34sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.453"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.009" />
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#751C1C"
android:backgroundTint="#CC2121"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.922"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

