Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将图像保存在二级文件夹中,res并通过 java 和 xml 访问。但是当我将图像文件夹导入res或导入外部时,它会显示错误。谢谢你。
res
图像应保存在 res 文件夹中名为 drawable 的文件夹中。你可以阅读以下链接:
你不能在/res目录中。Android 资源不支持二级目录层次结构。因为在 R.java 文件中生成了 id。
/res
唯一的方法是将这些图像放入/asset允许的二级目录层次结构中。
/asset
或者只是用文件夹名称前缀重命名您的图像,然后按原样放在 res 目录中。