ImageView出错

dianamei 2012-03-23 03:50:57
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/icon"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:src="@drawable/jm"


</ImageView>


Failed to convert @drawable/jm into a drawable
Couldn't resolve resource @drawable/jm
Exception details are logged in Window > Show View > Error Log
...全文
835 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
dianamei 2012-03-27
  • 打赏
  • 举报
回复
是路径问题。后来刷新好了。
垚淼 2012-03-24
  • 打赏
  • 举报
回复
drawable文件夹里没有jm文件
爬行的乌龟 2012-03-24
  • 打赏
  • 举报
回复
[Quote=引用楼主 dianamei 的回复:]
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/icon"
android:layout_width="fill_parent"
android:layout_h……
[/Quote]有可能是这里有错。不过,要是jm引用的是图片,那么图片加载失败,你刷新一下或者重新加载图片
a_tuzi 2012-03-23
  • 打赏
  • 举报
回复
jm的类型是什么?
小笨熊 2012-03-23
  • 打赏
  • 举报
回复
Failed to convert @drawable/jm into a drawable
你的jm是xml还是一个图片。。。如果是一个xml,检查xml是都有错误,如果是图片,检查是不是图片被损坏,是否存在等问题
changjiangzhibin 2012-03-23
  • 打赏
  • 举报
回复
删除R.java,重新生成一次
ihrthk 2012-03-23
  • 打赏
  • 举报
回复
很明显jm没有
1.检查项目里有没有jm图片。
2.检查R.java有没有jm字段,没有的话,删除gen目录,重新生成。
tangfei_honesty 2012-03-23
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
//应该问题出在这里
android:id="@+id/icon"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:src="@drawable/jm"
</ImageView>

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧