首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

ImageView出错,该如何处理

2012-04-18 
ImageView出错?xml version1.0 encodingutf-8?ImageViewxmlns:androidhttp://schemas.android.

ImageView出错
<?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

[解决办法]
<?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>
[解决办法]
很明显jm没有
1.检查项目里有没有jm图片。
2.检查R.java有没有jm字段,没有的话,删除gen目录,重新生成。
[解决办法]
删除R.java,重新生成一次

热点排行