Android – Can’t change button’s background color in XML .Android studio

androidbuttoncolorskotlintablelayout

Android studio screenshot

I created TableLayout then buttons. The button's color was automatically set purple. So I can't change them right now. It's my first time here.

Best Answer

don't use anything else use

<androidx.appcompat.widget.AppCompatButton
<!-- attributes-->
/>

instead of one

<Button
<!--attributes-->
/>

every thing will work nicely.

Happy coding.