【发布时间】:2015-07-05 10:24:20
【问题描述】:
当我尝试在布局文件中使用图像时出现此错误:
Couldn't resolve resource @drawable
Failed to convert @drawable/image into a drawable
这是我的布局文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/image"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
我尝试重新启动 IDE,clean-rebuild 但没有,我阅读了所有与之相关的线程(我认为)。 是的,我的图片名称仅包含 [a-z0-9_.]。
【问题讨论】:
-
图片名称和扩展名是什么?
-
检查资源名称是否包含非法字符
-
@itzhar 名称是“image.png”,但我试图删除扩展名,同样的错误
-
@jlopez 它不包含我在问题中提到的任何非法内容
-
我确定你看到了这个帖子*.com/questions/8874262/…。无论如何,请确保您没有任何其他同名文件
标签: android