更新时间:2023-01-27 20:13:34
当你应用主题并希望改变颜色而不是
when you apply theme and want to change color than
EX:
activity.setTheme(R.style.green);
<style name="green">
<item name="main_background">@drawable/background_green</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="button_light">@color/button_light</item>
</style>
主题颜色不能在特定主题的运行时更改。
如果要在应用程序中更改颜色,请设置自定义样式并更改这些样式。
Make custom style and change these styles when you want to change color in your application.