i have managed to make a RecyclerView list but am unable to center the text inside. Below are the codes:
RecyclerView:
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:layout_marginEnd="200dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Item:
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/listItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/caviar_dreams"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:paddingBottom="15dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
I have tried all properties i could find,alignText, gravity, alignLayout etc