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

Xaxage picture Xaxage · Nov 6, 2020 · Viewed 8.7k times · Source

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.

Answer

Shashank Pandey picture Shashank Pandey · Dec 7, 2020

don't use anything else use

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

instead of ony

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

every thing will work nicely.

Happy coding.