Difference between textColor and android:textColor

后端 未结 1 763
时光取名叫无心
时光取名叫无心 2021-01-25 05:50

I\'m sorry if my question looks beginner, but what\'s the difference between textColor and android:textColor? I can\'t understand where use which Thank

相关标签:
1条回答
  • 2021-01-25 06:29

    textColor is an attribute provided in AppCompat library, where as android:textColor is provided in Material theme.

    Example:

    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>
    

    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>
    
    0 讨论(0)
提交回复
热议问题