-2

my I have good quality images in my phone image gallery. When I try to add these files to ImageView it shows very blurry

<ImageView
        android:id="@+id/img_user"
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:adjustViewBounds="true"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:background="#CCC"
        android:scaleType="centerCrop" />

Why it is happening?

devrim
  • 307
  • 1
  • 3
  • 8

2 Answers2

1

Try setting your width and height to wrap_content, like this:

<ImageView
        android:id="@+id/img_user"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:adjustViewBounds="true"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:background="#CCC"
        android:scaleType="centerCrop" />

Or if you need to keep your ImageView size, try using Glide or Picasso to fit your image inside ImageView.

0

remove height : 250dp and make it wrap_content and that's it