初学者android开发问题



我正在跟随youtube上的教程,我试图放置背景图像,我一直在eclipse中出现错误。我将图像放在draw_hdpi文件夹中。然后在xml中,我有:

LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background_test.png"

但是,它一直说它找不到图像。我不知道我做错了什么。请帮助。谢谢你。

直接删除' .png'

android:background="@drawable/background_test"

你可以像以前那样引用它,但是没有。png。还有,你要关闭你的线性布局吗?

在命名图像时必须使用小写字母,不能使用任何特殊字符

相关内容

最新更新