Android中加载PNG图片时出现错误----No resource found
来源:互联网 发布:c语言折半查找法 编辑:程序博客网 时间:2024/06/03 22:04
Android程序没有任何错误,而工程却有错误,错误在Console中提示完全都是因为图片所引起的,如:
[2012-04-23 15:17:13 - MyView] D:\Android_work\MyView\res\layout\item01.xml:30: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/feature_guide_0').
原因可能是:直接更改文件后缀的问题,如果你是直接在eclipse里更改文件后缀,或者是在桌面上自己更改后缀,那么这个问题就出来了。
解决的办法:用画图工具,比如PS等把图片改成某一种格式,比如png,jpeg等,再放到drawable里,就不会出现错误。或者直接用windows里面的画图工具将每一张图片都另存为.png格式即可。
另外还有一个错误要提出来,就是drawable里文件的命名问题,目前只能是用用小写字母和数字命名图片文件,比如拷贝一个Moon.jpg文件到drawable文件夹后,就会出现错误,改为小写命名则错误消失
- Android中加载PNG图片时出现错误----No resource found
- Android中加载PNG图片时出现错误----No resource found
- android studio 出现错误 No resource found that matches the given name...
- 在创建Android项目时出现appcompat_v7中的引用的组件出现No resource found
- 升级android sdk到5.0时,创建项目出现错误:No resource found that matches the given name 'android:Widget.Material.A
- android studio 降低项目版本错误,no resource found
- eclipse Android更新SDK或重新配置adt后出现Error retrieving parent for item: No resource found 错误
- No resource found android:WindowTitleBackground
- No resource found that matches the given name 9png
- android中加载图片时出现oom
- 出现错误 No resource found that matches the given name '@style/Theme.AppCompat.Light'
- 图片资源添加出现问题: No resource found that matches the given name
- 解决调试android程序,出现错误“No Launcher activity found”
- android开发出现No Launcher activity found错误的解决方案
- Android - 错误:"No resource found that matches the given name android:Theme.Material"
- android报Error:No resource identifier found for attribute 'roundIcon' in package 'android'错误解决方法
- Android出现Error:No resource identifier found for attribute XXX in package
- 出现的问题:error: No resource identifier found for attribute 'layou_width' in package 'android'
- LoadRunner11 安装&破解&汉化
- GO 语言中json的简单使用(实例)
- ASP.NET中DOC模板的书签制作
- 把Google HK设为IE8-9-10-11默认的搜索引擎
- Oracle 容易忽略的地方1
- Android中加载PNG图片时出现错误----No resource found
- 杂
- android flash 下载完整性检查
- 好久没写博客了
- 解决js无法提交表单并关闭窗口的简单方法
- Bootstrap下拉菜单
- 关于排序算法的调用和性能
- List和数组的转换方法
- Deep Learning 资料汇总