UNEX
UNEX

Reputation: 77

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 ?

enter image description here

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

Upvotes: 3

Views: 1660

Answers (2)

Jarik Karsten
Jarik Karsten

Reputation: 37

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.

Upvotes: 1

Saurabh Bhandari
Saurabh Bhandari

Reputation: 2458

Add this property in Your image View

android:src="@mipmap/idlepoor_moneys"

Remove the following line from your code

app:srcCompat="@mipmap/idlepoor_moneys"

Upvotes: 6

Related Questions