简体   繁体   中英

android eclipse resource image not found in drawable

error: No resource found that matches the given name (at 'background' with value '@drawable/mydroidbg.png').

here's the location of my image: C:\\Users\\Rogeross\\Documents\\ECLIPSE\\MyFirstApp\\res\\drawable-hdpi\\mydroidbg.png

here's the main.xml code:

<?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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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