0

how can I change the button color when I already use the background?

<Button
    android:id="@+id/button"
    android:layout_width="61dp"
    android:layout_height="45dp"
    android:layout_marginTop="44dp"
    android:layout_marginEnd="36dp"
    android:background="@drawable/rounded_corner"
    android:text="Ge"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

rounded_corner

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="24dp" />
<solid android:color="#f5deb3" />
</shape>

It's still purple why?

Zoe
  • 27,060
  • 21
  • 118
  • 148

1 Answers1

0

Ok so since API 21 its been changed.

android:backgroundTint="@color/red"

This will change the color of the Button.

Priyaank
  • 141
  • 6