skip to Main Content

I’m trying to load an image into an image view:
enter image description here

but the image is cropped inside the image view:

enter image description here

 <ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="30dp"
    android:layout_marginBottom="10dp"
    android:gravity="center"
    android:scaleType="centerCrop"
    android:src="@mipmap/icona_animal_app" />

why does this thing happen? how can i solve?

2

Answers


  1. Try changing android:scaleType="centerCrop" to android:scaleType="fitCenter"

    Login or Signup to reply.
  2. According to your screenshot, ImageView has rounded corners:
    enter image description here

    So I assume there is another code affecting that view which causes cropping and rounded corners.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search