【发布时间】:2012-12-26 07:39:37
【问题描述】:
我如何将图像包含为背景以及在应用程序中放置图像的位置和方式,我正在使用 Eclipse 和所有开发工具。
这是我在 main_activity.xml 中到目前为止所做的:
<RelativeLayout 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="#C0C0C0"
tools:context=".MainActivity">
</RelativeLayout>
【问题讨论】:
-
android:background="#c0c0c0" 是我现在设置的背景颜色,一旦我让图像背景工作,我就会删除该行
-
将颜色更改为 android:background="@drawable/your_background_img"
-
您必须将图像保存在项目的 res/drawable 文件夹中
标签: android eclipse android-layout android-emulator android-2.2-froyo