本文介绍了textColor和android:textColor之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
很抱歉,如果我的问题是初学者,但是 textColor
和 android:textColor
有什么区别?我不明白在哪里使用谢谢您的帮助
I'm sorry if my question looks beginner, but what's the difference between textColor
and android:textColor
? I can't understand where use whichThanks for your help
推荐答案
textColor
是AppCompat库中提供的属性,其中Material主题中提供了 android:textColor
textColor
is an attribute provided in AppCompat library, where as android:textColor
is provided in Material theme.
示例:
使用Material主题并引用 android:textColor
属性:
Using Material theme and referring android:textColor
attribute:
<style name="AppTheme" parent="android:Theme.Material.Light">
<item name="android:textColor">@color/blue</item>
<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_dark</item>
....
....
</style>
仅将AppCompat库与 textColor
属性一起使用:
using AppCompat library with only textColor
attribute:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="textColor">@color/blue</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
...
...
</style>
这篇关于textColor和android:textColor之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!