在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