简体   繁体   中英

ImageView doesn't appear

I have dragged an ImageView to layout and I selected the picture. But when I execute the application, It doesn't appear. What can I do to solve this ?

在此处输入图片说明

ImageView XML code;

<ImageView
    android:layout_width="250dp"
    android:layout_height="250dp"
    app:srcCompat="@mipmap/idlepoor_moneys"
    android:id="@+id/imageView4"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true" />

Add this property in Your image View

android:src="@mipmap/idlepoor_moneys"

Remove the following line from your code

app:srcCompat="@mipmap/idlepoor_moneys"

As allready said change

app:srcCompat="@mipmap/idlepoor_moneys"

to

android:src="@mipmap/idlepoor_moneys"

Also I recommend to put your images in the @drawable folder. The mipmap is where app icons are stored when making an app.

app:src="@drawable/idlepoor_moneys"

You can easily find the drawable from your project map. If you can't find it you can always right click the folder to get the path to it.

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