简体   繁体   English

在drawable中找不到android eclipse资源图片

[英]android eclipse resource image not found in drawable

error: No resource found that matches the given name (at 'background' with value '@drawable/mydroidbg.png'). 错误:找不到与给定名称匹配的资源(在“背景”处,值为“ @ drawable / mydroidbg.png”)。

here's the location of my image: C:\\Users\\Rogeross\\Documents\\ECLIPSE\\MyFirstApp\\res\\drawable-hdpi\\mydroidbg.png 这是我图片的位置:C:\\ Users \\ Rogeross \\ Documents \\ ECLIPSE \\ MyFirstApp \\ res \\ drawable-hdpi \\ mydroidbg.png

here's the main.xml code: 这是main.xml代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" 
android:background="@drawable/mydroidbg.png"  //error here
>


<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="TOTO ANDROID" 
    android:gravity="center"
    />

 <Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="PRESS ME!!"
    android:textSize="19dp"
    android:textStyle="bold"
     />

    </LinearLayout>

i already cleaned, refreshed my project but it still cannot see my image file... please help.... 我已经清理过,刷新了我的项目,但是它仍然看不到我的图像文件...请帮助...。

Do not mention the file extension. 不要提及文件扩展名。 Use: 采用:

android:background="@drawable/mydroidbg"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM