When using Theme.MaterialComponents.Light.NoActionBar style, setting Button Background has no effect

If you want a true Button, but one that you can modify like the framework Button (instead of the MaterialButton), then you can explicitly specify the framework version in your layout file. Replace this:

<Button
    android:id="@+id/item_popupwindows_cancel"
    ... />

with this:

<android.widget.Button
    android:id="@+id/item_popupwindows_cancel"
    ... />

This will give you what it says on the tin: an android.widget.Button, which should respond to styling the way you expect.

Similarly, you could use a <androidx.appcompat.widget.AppCompatButton> if you want support library features but not material components features.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)