Is it possible to set the color of a string directly in string.xml?

前端 未结 12 1018
轮回少年
轮回少年 2021-02-07 12:17

I mean something like:

Error!
12条回答
  •  生来不讨喜
    2021-02-07 12:43

    In Strings.xml:

    
            #ac8888
            #f56415
            #95cd08
      
    

    Then in the code:

     TextView myText = (TextView) findViewById(R.id.tvJugador1);
      myText.setTextColor(R.color.mygreen);
    

提交回复
热议问题