我寻找谷歌和保持对搜索关键字的战斗,但仍然没有。设置指定视图背景的风格和主题的变化
我只想要什么样的:
<style name="Theme.DefaultWhite" parent="@android:style/Theme.DeviceDefault">
<item name="android:background">#ffffffff</item>
<item name="MyCustomBackground">#33ffffff</item>
</style>
<style name="Theme.DefaultBlue" parent="@android:style/Theme.DeviceDefault">
<item name="android:background">#ffffffff</item>
<item name="MyCustomBackground">#3388ffff</item>
</style>
,并在我的指定设置的项目(另一人使用Android默认的)意见。
<ImageView>
id = "@+id/NNI_ivCards"
background="@style/MyCustomBackground"
</ImageView>
<ImageView>
id = "@+id/NNI_ivBarRoot"
</ImageView>
NNI_ivCardsImageView
必须由主题来改变背景颜色,以及NNI_ivBarRoot将无法通过主题改变。
我需要风格化的自定义资源,它的价值观根据主题而改变。
如果Android设计为不在样式中添加额外的自定义值,我需要尽可能短的Java代码。
我不能与主题改变它的风格,如果我硬编码视图样式。 – nyconing
所以你需要改变主题的代码,以及随主题变化的颜色。再次看到我的答案来解决它。 –
你是我的英雄!设置?attr/color1做到了!!!!!!那attr可能需要在之下? –
nyconing