【问题标题】:how to change background image of an activity如何更改活动的背景图像
【发布时间】:2014-10-16 17:31:01
【问题描述】:

大家好。 我是一名入门 android 程序员,我想知道如何自定义它们。例如,如何为活动的背景设置图像。

【问题讨论】:

    标签: android-layout android-activity


    【解决方案1】:

    在你的android项目的drawable文件夹中放置一个图像文件,然后在你的activity的xml文件中

    <?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>
    

    【讨论】: