Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在活动中插入图像_Android_Image - Fatal编程技术网

Android 如何在活动中插入图像

Android 如何在活动中插入图像,android,image,Android,Image,我已将jpeg图像传输到drawable,但出现错误: 无法将@drawable/background转换为可绘制 android:background="@drawable/blue background" ^^如果您想知道转换失败,那么名称中应该有一个空格,因为所有资源名称只能包含[a-Za-z0-9.] 换句话说,不能有空间 我认为您应该删除文件名中的空格, 然后,您可以尝试android:src=“your drawable path”文件名中是否有空格?android要求所有draw

我已将jpeg图像传输到drawable,但出现错误: 无法将@drawable/background转换为可绘制

android:background="@drawable/blue background"

^^如果您想知道

转换失败,那么名称中应该有一个空格,因为所有资源名称只能包含
[a-Za-z0-9.]


换句话说,不能有空间

我认为您应该删除文件名中的空格,
然后,您可以尝试android:src=“your drawable path”

文件名中是否有空格?android要求所有drawable和XML都是小写的,并且没有空格!将图像名称更改为蓝色背景,不允许尝试空间。你可以使用的字符只有:字母、数字(不是开头)、下划线和点。如果你想知道的话,名字中不应该有空格