android Studio 中的按钮颜色未更改

Button color not changing in android Studio

所以我只是进入 android studio 中的属性来更改按钮的颜色,就像我更改按钮的名称和其他属性一样。但是现在当我在 phone 上编译和 运行 时,颜色似乎没有生效。 我只能在更改主题视图时看到颜色变化,但是在编译并发送到 phone.

时看不到它
<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"
tools:context=".MainActivity">


<Button
            android:id="@+id/btn_answer2"
            android:layout_width="wrap_content"
            android:layout_height="200dp"
            android:layout_weight="1"
            android:background="#FA39D328"
            android:backgroundTint="#E10A0A"
            android:text="Button" />

This is the only options i have with theme, I can see the the color only on different themes but they do not show up when I run the app. Before changing attributes would change the color

This is the attributes change

删除 android:background="#FA39D328",仅使用 android:backgroundTint="#E10A0A"。

<Button
            android:id="@+id/btn_answer2"
            android:layout_width="wrap_content"
            android:layout_height="200dp"
            android:layout_weight="1"
            android:backgroundTint="#E10A0A"
            android:text="Button" />

使用 AppCompatButton


    <androidx.appcompat.widget.AppCompatButton
        android:id="@+id/click"
        android:background="#FA39D328"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/pay_now"
        app:layout_constraintBottom_toBottomOf="parent" />