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"> 

  亲测有效!!!

 

posted @ 2021-01-08 15:54  MElephant  阅读(2167)  评论(0编辑  收藏  举报