Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.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 - Fatal编程技术网

Android 如何将图像作为背景?应用程序不断崩溃

Android 如何将图像作为背景?应用程序不断崩溃,android,Android,我想将图像/图片作为背景,但使用android:background=“#ffff”将其设置为白色,并且可以正常工作。一旦我切换到android:background=“@drawable/background\u image”并运行它,崩溃。用另一个图像试试 有时,当您的图像在Png中消失,然后将其更改为jpg扩展时,您需要使android stdiuo失效/重新启动可能您的图像太大,分辨率太高,尝试使用此网站压缩并调整其大小,并将压缩后的图像作为背景,如果不起作用,也尝试将图像放在xhdpi

我想将图像/图片作为背景,但使用
android:background=“#ffff”
将其设置为白色,并且可以正常工作。一旦我切换到android:background=“@drawable/background\u image”并运行它,崩溃。

用另一个图像试试


有时,当您的图像在Png中消失,然后将其更改为jpg扩展时,您需要使android stdiuo失效/重新启动

可能您的图像太大,分辨率太高,尝试使用此网站压缩并调整其大小,并将压缩后的图像作为背景,如果不起作用,也尝试将图像放在xhdpi或xxhdpi文件夹中

背景图像是否可用于绘制文件夹?是的,它放在那里
没有崩溃
-您刚才说它在标题中崩溃。我标记的问题解释了你的问题在主题上遗漏了什么。至于现在,它是离题的,因为它缺少异常堆栈跟踪、相关代码等。请查看以确定崩溃的原因。[这有助于修复itI已修复,但现在imageview中的图片不可见。请在您发表评论后立即向我们显示代码我已修复它。