[英]Why android xml file name must contains only lowercase letters and digits ([a-z0-9_.])?
I am usually name my file in camelCase (like tabActive
). 我通常在camelCase中命名我的文件(如
tabActive
)。 But it is not allowed in Android. 但Android中不允许这样做。
Is there any reason why android xml file name must contains only lowercase letters and digits ([a-z0-9_.])? android xml文件名是否必须只包含小写字母和数字([a-z0-9 _。])?
Error:Gradle: Execution failed for task ':app:mergeDebugResources'.
错误:Gradle:任务':app:mergeDebugResources'的执行失败。
/home/trungdq/.../res/drawable/tab-active.xml: Error: Invalid file name: must contain only lowercase letters and digits ([a-z0-9_.])
/home/trungdq/.../res/drawable/tab-active.xml:错误:文件名无效:必须只包含小写字母和数字([a-z0-9_。])
It's simple: out of xml filenames the Java constants
get generated. 这很简单:从xml文件名中生成
Java constants
。 The later have very strict rules about how they may be built 后者对如何建造它们有非常严格的规定
您可以这样认为,如果xml名称支持大写AZ,但程序如何区分“Activity_Main_Layout.xml”和“activity_main_layout.xml”,当您在代码中使用xml文件时,很难理解。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.