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

眉间皱痕 提交于 2019-12-01 16:27:36

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!