修改现有主题 [英] Modify existing theme
问题描述
我想知道是否有可能(以及如何)自定义现有的主题。
I would like to know if it is possible (and how) to customize an existing theme.
我要找的是我怎么可以检索特定属性(即颜色),并改变它,当活动
开始之前<$ C重新修改后的主题$ C>的setContentView()。
What I'm looking for is how can I retrieve a certain attribute (i.e. color) and change it when the Activity
starts and reapply the modified theme before setContentView()
.
到 setTheme
但(),而不是使用资源ID相似,使用修改后的主题。
Similar to setTheme()
, but instead of using a resource id, use the modified theme.
推荐答案
根据进一步的研究和Eric的评论目前还没有以编程方式修改一个主题一个可行的办法。不同的主题可以应用编程但是不能修改。一旦样式以XML设置,则它不能被修改
Based on further research and Eric's comment there is not yet a possible way to modify a theme programmatically. Different themes can be applied programmatically but not modified. Once the style is set in XML, it cannot be modified.
这篇关于修改现有主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!