设置基本Android应用程序的背景(Setting background for basic android app)
我目前正在使用eclipse作为我的IDE工作的基本应用程序。 我目前无法将图像设置为背景。 我跟踪了一个告诉我将我的图像放在drawable-mdpi文件夹中并将其命名为图标的tutoral。 我试过这个,但它仍然放在andriod图标中,即使我删除了andriod图标图像。 有更好的方法吗?
谢谢
I am currently working on a basic app using eclipse as my IDE. I am currently having trouble setting an image as my background. I was following a tutoral which told me to place my image in the drawable-mdpi folder and name it as icon. I have tried this but it keeps on placing in the andriod icon instead even when i delete the andriod icon image. Is there a better way of doing this?
Thanks
最满意答案
尝试这个:
<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>background是一个.png文件。 使用Nine9Patch用边框绘制它。
希望这可以帮助
try this:
<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>background is a .png file. with borders draw around it with Nine9Patch.
Hope this helps
更多推荐
发布评论