Text view with different colored texts in xml code

后端 未结 4 1668
情歌与酒
情歌与酒 2020-12-16 16:41

I need my textview to have different colored texts. Also I need to do this from xml code, non from java code. Is there anyone who knows some way fo

4条回答
  •  失恋的感觉
    2020-12-16 17:28

    
    

    Where "RED" is a named constant you have to define under res/values/ in an xml file. Typically i create "colors.xml".

    Or see this for a good set of predefined colors: Web colors in an Android color xml resource file

提交回复
热议问题