命名为Android资源规则 [英] Naming rules for Android resources

查看:113
本文介绍了命名为Android资源规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里可以找到为Android资源的命名规则?我发现这要归功于我必须[A-z0-9._]中使用的字符编译错误,但我也有一个名为图像401.png错误。当使用我的布局使用它

where can I find the naming rules for Android resources? I found out thanks to compilation errors that I must use characters within [a-z0-9._], but I also have an error with an image named 401.png. When using it in my layout using

@drawable/401

我碰到下面的编译错误:

I get the following compilation error:

invalid VariableDeclaratorId

我无法找到的文档,这些规则,我想我命名文件之前,要知道所有的人。

I can't find these rules in the doc, and I'd like to know all of them before naming my files.

感谢

推荐答案

该规则是相同的 Java标识的,因为每个资源必须在R.java文件生成一个相应的ID字段

The rules are the same as for Java identifiers since each resource must have a corresponding ID field generated in the R.java file.

这篇关于命名为Android资源规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆