April 6, 2025
1/09/2016

How to Set TextColor for TextView in Android

In the string.xml file use the following tag
 <string name="CodeColor" >"#0000ff"</string>
In the layout files you can call to the colors or styles:
android:textColor="@color/titlecolor"
Or you can use:



You can use
  textView1.setTextColor(getResources().getColor(R.color.mycolor))
or
  textview1.setBackgroundColor(Color.parseColor("#ffffff"));
or
    textview1.setBackgroundColor(Color.RED);
or
    textView1.setBackgroundColor(R.color.black);

0 comments:

Post a Comment

Thank you for your comment.

Copyright © 2016 Android Help and Tutorials All Right Reserved