I have a button and I gave the cornerRadius attribute. In the xml code, the app appears o be curved but when I run the app, the button is rectangular in shape.
<?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:id="@+id/res_item"
android:forceDarkAllowed="false"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="70dp">
<ImageView
android:id="@+id/res_item_image"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:src="@drawable/ic_icon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.494" />
<TextView
android:id="@+id/res_item_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:fontFamily="@font/salsa"
android:text="Name"
android:textColor="@color/black"
android:textSize="20sp"
app:layout_constraintEnd_toStartOf="@+id/add"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@id/res_item_image"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/res_item_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/salsa"
android:text="price"
app:layout_constraintTop_toBottomOf="@id/res_item_name"
app:layout_constraintStart_toEndOf="@id/res_item_image"
android:layout_marginLeft="20dp"
android:textColor="@color/tomato_red"
android:textSize="18sp" />
<Button app:cornerRadius="20dp"
android:id="@+id/add"
android:layout_width="70dp"
android:layout_height="40dp"
android:layout_margin="20dp"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="30dp"
android:text="Add"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Instead of this button I also used material button, but still the same happens. It appears to be curved in the XML design, but it isn't in the app.