How to set text color in android app for all text?

后端 未结 5 845
执念已碎
执念已碎 2021-02-01 12:16

I want to define a default text color for my android app.

I have a base activity class, that all activities are extended from it and I thought this might be a good place

5条回答
  •  太阳男子
    2021-02-01 12:54

    Set your default color in your res/values/colors.xml like this

    #ffffff
    

    So this color to all your texts

    android:textColor="@color/defaultTextColor"
    

    or

    textView.setTextColor(R.color.defaultTextColor);
    

提交回复
热议问题