Android的图片背景 [英] Android picture in background
问题描述
您好,我不知道如何去了解这一点,但我希望把所有画面的背景图片,而不是它是黑色的。我将如何做到这一点通过XML或Java code和什么样的布局我本来如果是在XML使用?
Hi, I have no clue how to go about this but I want to put in the background of all the screens a picture instead of it being black. How would I do this through XML or the Java code and what kind of layout would I have to use if it is in XML?
推荐答案
只需添加的android:背景=@绘制/ your_image
将XML的根布局。
它会被拉伸,以填补所有的屏幕,所以如果你的图像不完全匹配的屏幕尺寸,你需要创建在其中声明图像的属性另一BitmapDrawable XML。
Just add android:background="@drawable/your_image"
to the root layout of your XML.
It will be stretched to fill all the screen, so if your image doesn't perfectly match the screen size you'll need to create another BitmapDrawable XML in which you declare the properties of the image.
这篇关于Android的图片背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!