当前位置: 动力学知识库 > 问答 > 编程问答 >

dynamic - Android: How to change theme attributes dynamically at runtime from code

问题描述:

I'm using AppCompat, my app has dynamic color themes. I want to be able to change the primaryColor and accentColor attributes so that UI elements will match the theme colors (e.g. progress bars, check boxes, etc.).

I can manually set colors for a lot of views, but that gets complicated for elements like checkboxes and progress bars where I do not want to generate my own drawable. Obviously using static XML doesn't work for this either.

Is changing theme attributes for an Activity possible from code?

分享给朋友:
您可能感兴趣的文章:
随机阅读: