0

I have some activity and this button there, i want it to be white and whith round cornerns

<Button
        android:layout_width="143dp"
        android:layout_height="73dp"
        android:background="@drawable/round_white_button"
        android:backgroundTint="@color/white"
        android:text="@string/_13"
        android:textColor="@color/black"
        />

so i have this drawable file, but button color is violet. Why it's not working

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/white" />
    <corners android:radius="11dp" />
</shape>
Junaid Khalid
  • 811
  • 2
  • 11
  • 26
miclelov
  • 35
  • 5

1 Answers1

0

There is easy way to add shape to your button MaterialButton has a lot feature one of them you can set corner

  <com.google.android.material.button.MaterialButton
    android:id="@+id/btAdd"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="16dp"
    android:insetTop="0dp"
    android:insetBottom="0dp"
    android:text="@string/add_address"
    app:cornerRadius="8dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/edit_phone"
    app:layout_constraintVertical_bias="0.0" />

You can use conrenrRadius and change ripple effect color and more

salman
  • 86
  • 1
  • 6