Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Android Studio中以特定方式编辑colors.xml_Android_Xml_Android Studio_Colors - Fatal编程技术网

如何在Android Studio中以特定方式编辑colors.xml

如何在Android Studio中以特定方式编辑colors.xml,android,xml,android-studio,colors,Android,Xml,Android Studio,Colors,有没有可能在colors.xml中执行类似的操作 例如: //define a constants with color name and color value red = #ea1111 // and than use it like this <color name="colorPrimary">red</color> 我的问题是:我是否可以在xml中声明类似全局变量的内容,并在xml文件中的任何位置调用该变量?确定要以颜色声明它: <color name=

有没有可能在colors.xml中执行类似的操作 例如:

//define a constants with color name and color value
red = #ea1111
// and than use it like this
<color name="colorPrimary">red</color>

我的问题是:我是否可以在xml中声明类似全局变量的内容,并在xml文件中的任何位置调用该变量?

确定要以颜色声明它:

<color name="colorPrimaryDark">#303F9F</color>
然后您可以像这样访问它:

<item name="colorPrimary">@color/colorPrimary</item>
666@color/撒旦?