如何改变的活性的背景图像

如何改变的活性的背景图像

问题描述:

喜每一个人。 我是一个入门的Andr​​oid程序员,我想知道我怎样才能使一个自定义的them.for例子,我怎么可以将图像设置为活动的背景。

Hei every one. I'm an starter android programmer and I'd like know how can I make a custom them.for example how can I set an image for background of an activity.

放置一个图像文件中的您的Andr​​oid项目的绘制文件夹,然后在活动的XML文件

place an image file in the drawable folder of your android project,then in your activity's xml file

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/myId"
    android:orientation="vertical" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:background="@drawable/backgroundImage">   <!--specify the image here-->
</RelativeLayout>