问题描述
我是新来的Android和刚刚开始的。我创建了资源文件夹,菜单/ mainMenu.xml文件。但我得到了错误
I am new to android and just started it. I created a file in res folder, menu/mainMenu.xml. But i got the error
Error: res/menu/mainMenu.xml: invalid file name: must contain only[a-z0-9_.]
当我改变了文件名只的MainMenu(删除资本M),然后它开始工作。为什么?我使用的IntelliJ 10.5.1。
When i changed the file name to just mainmenu(remove the capital M) then it started working. Why? I am using intelliJ 10.5.1.
感谢
推荐答案
应该 mainmenu.xml
,没有大写字母是允许在XML文件命名。
it should be mainmenu.xml
,no capital letter is allowed in naming of xml files.
File name must contain only lowercase a-z, 0-9, or _.
-
仅
AZ
,记住,不是资本......而空白不允许
only
a-z
,mind that not capital...andwhite-space not allowed
名称必须以character.not用数字(0-9)
name must start with a character.not with a Number(0-9)
名存实亡
_
符号allowed.no其他符号alowed。name only
_
symbol allowed.no other symbol alowed.这篇关于收到错误错误:RES /菜单/ mainMenu.xml:无效的文件名:必须只包含[A-Z0-9 _]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!