Android .xml files: Why do predefined colors not work for me?

后端 未结 6 1745
慢半拍i
慢半拍i 2020-12-06 09:03

When I look at misc. Android tutorials and examples when it comes to specifying colors I very often see constants like @color/red or @color/black e

6条回答
  •  误落风尘
    2020-12-06 09:43

    An important part of this that no one else has mentioned is that the reference to the color has to be

    @color/black
    

    but the xml file has to be

    colors.xml
    

    (note plural in the xml file name but not plural @color)

提交回复
热议问题