Android Studio Button background color cannot be modified

About the Android Studio Button background cannot be modified, it always appears bright purple

As an Android beginner, I found that the background color of the Button cannot be modified, nor can I link to the drawable style xml file. I have been tossing for a long time. After consulting the CSDN, I found that it is a problem with the new version of the theme file. Share the method to those who need it. people

Reason: due to the theme issue of the new version

Solution: Change themes in the app/res/values ​​directory

"<style name=..." Change the code to the following to restart Androidstudio

    <style name="Theme.AndroidLearning" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge">

Guess you like

Origin blog.csdn.net/wzy1120433847/article/details/113091080