开发者

Why can't file names in the drawable folder contain special characters or start with a capital letter?

开发者 https://www.devze.com 2023-03-21 08:05 出处:网络
Is there a point to 开发者_运维问答these rules?Each file inside folder is translated into java field name inside R.java class:

Is there a point to 开发者_运维问答these rules?


Each file inside folder is translated into java field name inside R.java class:

drawable\icon.png -> R.drawable.icon

Hence the reason for not using special characters inside file names, as they can no be used in Java names.

As for capital letters, I guess that's to avoid one little problem in Windows vs. Linux environment. That's because Linux thinks that Icon.png and icon.png are different files, and Windows thinks that Icon.png and icon.png is the same file. So anyone using Linux can create application that is not compilable on Windows.


You can see some discussion about this, Here

0

精彩评论

暂无评论...
验证码 换一张
取 消