初学android没几天,界面设计在网上看范例的时候发现一个问题,为什么有些的控件样式写在drawable/XXX.xml目录里,用@drawable/引用?为什么有的控件样式写在values/style.xml文件里,用@style/引用?有的控件样式甚至两个方法都用上了,这样操作完成一个项目的样式结构岂不是很混乱?
在网上看到还有的源码,用style就可以解决的,他用drawable文件解决,本人不得其解,希望同仁帮忙解答困惑。
伊谢尔伦2017-04-17 12:59:46
The style of a control includes many attributes, such as background, foreground (ImageView), appearance animation, disappearing animation, etc.
The files in the drawable folder are defined for a certain attribute. For example, if I want to define a red rounded rectangle background, I will write an xml file with a shape tag in the drawable folder. Then reference
via @drawableThe files in the style folder are defined for a certain type of control (a collection of several properties). There are generally two situations when defining in the style folder