设置图片作为背景android系统中的活动 [英] Setting a picture as a background for an activity in android
问题描述
我想设置设置这张图片 soccer_field
在绘制
文件夹中。当我查看图形布局它显示的背景,但是当我在我的设备上运行它,它不..
I am Trying to set to set this picture soccer_field
in drawable
folder. When I view the "graphical layout" it is showing the background, but when I run it on my device it is not ..
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/soccer_field"
android:orientation="horizontal">
</LinearLayout>
这是怎么回事,如何解决呢?
Why is this happening and how to solve it ??
推荐答案
唯一的区别可能是仿真器和设备之间不同的屏幕分辨率。因此,也许你的设备是寻找像绘-xhdpi另一个文件夹绘制在他们或适合于设备的分辨率的任何其他文件夹,绘制它无法找到绘制。
The only difference might be different screen resolutions between Emulator and your device. So maybe your device is looking in another drawable folder like drawable-xhdpi and it cannot find the drawable in their or in any other drawable folder suitable for the device resolution.
<一个href=\"http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources\"相对=nofollow>在这里您可以找到更多有关此
这篇关于设置图片作为背景android系统中的活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!