为基本的安卓应用设置背景

4
我目前正在使用Eclipse作为我的IDE开发一个基本的应用程序。我目前遇到的问题是将图片设置为我的背景。我按照教程将图片放置在drawable-mdpi文件夹中并将其命名为icon,但尽管我删除了Android图标图片,它仍然会被放置在Android图标上。有没有更好的方法来解决这个问题?
谢谢。
1个回答

4

试试这个:

<LinearLayout
       xmlns:android="http://schemas.android.com/apk/res/android"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       android:orientation="vertical"
       android:gravity="center_horizontal" android:background="@drawable/background"></LinearLayout>             

背景是一个 .png 文件。使用 Nine9Patch 绘制边框。

希望这有所帮助。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接