在styles.xml appTheme指定有默认textColor属性:如何覆盖自定义textView样式颜色的AppTheme textColor?
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:textColor">@color/colorFontWhite</item>
</style>
这是对子级完美的,如果有可能覆盖它使用在styles.xml文件,这个新项目所需的一些情况:
<style name="CustomTextView" parent="@android:style/Widget.TextView">
<item name="android:textColor">@color/colorFontGreen</item>
</style>
并指定其所需的TextView XML布局是这样的:
<TextView
android:id="@+id/text"
style="style/CustomTextView"/>
的问题是,什么是不行的,因为自定义正在使用我的自定义主题(白色)的默认颜色显示textview,而不是使用该自定义样式为该文本视图(绿色)指定的自定义颜色。
我在做什么错?
感谢
风格= “风格/ CustomTextView” - >风格= “@风格/ CustomTextView” – Shaishav