设置基本Android应用程序的背景(Setting background for basic android app)

编程入门 行业动态 更新时间:2024-10-27 19:26:04
设置基本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

更多推荐

本文发布于:2023-07-16 18:30:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1132397.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   背景   Setting   Android   android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!