Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageView doesn't appear

Tags:

android

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" />
like image 333
UNEX Avatar asked Jun 14 '26 00:06

UNEX


2 Answers

Add this property in Your image View

android:src="@mipmap/idlepoor_moneys"

Remove the following line from your code

app:srcCompat="@mipmap/idlepoor_moneys"
like image 93
Saurabh Bhandari Avatar answered Jun 16 '26 13:06

Saurabh Bhandari


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.

like image 23
Jarik Karsten Avatar answered Jun 16 '26 13:06

Jarik Karsten



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!