简体   繁体   English

为什么android xml文件名必须只包含小写字母和数字([a-z0-9_。])?

[英]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.

相关问题 出现错误错误:res / menu / mainMenu.xml:无效的文件名:必须仅包含[a-z0-9_。] - getting error Error:res/menu/mainMenu.xml:invalid file name:must contain only[a-z0-9_.] res \ layout \ Contact_us.xml:文件名无效:必须仅包含[a-z0-9_。] - res\layout\Contact_us.xml: Invalid file name: must contain only [a-z0-9_.] 无效的文件名:必须仅包含[a-z0-9_。] - Invalid file name: must contain only [a-z0-9_.] "“无效的文件名:必须仅包含 [a-z0-9_.]”,用于 Android Studio 中的声音文件" - “INVALID FILE NAME: MUST CONTAIN ONLY [a-z0-9_.]“ for sound files in Android Studio java android:res \\ drawable-hdpi \\ Restaurant-Blue-2-icon.png:无效的文件名:必须仅包含[a-z0-9_。],无法修复 - java android: res\drawable-hdpi\Restaurant-Blue-2-icon.png: Invalid file name: must contain only [a-z0-9_.], cant fix Android Studio 解决方法:基于文件的资源名称必须仅包含小写 az、0-9 或下划线 - Android Studio Workaround: File-based resource names must contain only lowercase a-z, 0-9, or underscore Android Studio 文件名必须以.xml结尾 - Android Studio File name must end with .xml Android Studio 中 jpg 文件的“文件名必须以 .xml 结尾”错误 - “the file name must end with .xml” error for jpg file in Android Studio android工作室。 错误:文件名必须以.xml结尾 - android studio. Error: The file name must end with .xml 如何检查字符串是否正确地只包含数字或字母? 安卓 - how to check if string contains only numerics or letters properly? Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM