Set Text Color for textView Android

后端 未结 8 1860
梦谈多话
梦谈多话 2021-02-06 03:41

In the string.xml file i use the following tag

 \"#0000ff\"

If I use

 textview         


        
8条回答
  •  后悔当初
    2021-02-06 03:51

    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);
    

提交回复
热议问题