【Android开发】Android Studio 中的 button 无法使用 background 更改背景颜色

•解决方案
res/values/themes.xml下的

<style name="Theme.HelloWorld" parent="Theme.MaterialComponents.DayNight.DarkActionBar">

改为

<style name="Theme.HelloWorld" parent="Theme.MaterialComponents.DayNight.DarkActionBar.Bridge"> 

亲测有效!!!

猜你喜欢

转载自blog.csdn.net/weixin_42020386/article/details/112761608