我希望我能解释一下我之后的情况。 从本质上讲,我的用户要求我允许我对我的申请持不同看法,我希望我能够处理主题。
我希望我能够这样做:
<style name="NewTheme" parent="android:Theme.Dark">
<item name="labelColor">#f90</item>
<item name="buttonColor">#fff</item>
<item name="buttonBg">@drawable/button</item>
</style>
<style name="OldTheme" parent="android:Theme.Dark">
<item name="labelColor">#fa0</item>
<item name="buttonColor">#88f</item>
<item name="buttonBg">@drawable/button_old</item>
</style>
然后在我的风格中参考这些价值观:
<style name="labelStyle">
<item name="android:textColor>@labelColor</item>
</style>
<style name="buttonStyle">
<item name="android:textcolor">@buttonColor</item>
<item name="android:background">@buttonBg</item>
</style>
I know this syntax is wrong, but what might be the right syntax? Basically, I want to create sets of attributes (color, background, a couple other things) and select them based on theme.