[Android] Set Text Color for TextView 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);
No comments: