Zach Bublil
Zach Bublil

Reputation: 867

android imageview display in bad quality

I try to display 3 images medium size. The problem is that they display in low quality and it damages the UI a lot,I checked over the internet and the best solution is to use is Piccaso,but I want to know how can I display the image in it's full quality without third-library? I load images like this:

<ImageView
        android:id="@+id/btnring"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/itayring1"

        />

and I also tried this:

Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.itayicon);
    b1.setImageBitmap(bb);

When I used Eclipse I could load images easly. There must be a way to do in Android Studio too, Thanks.

Upvotes: 2

Views: 2248

Answers (1)

Kishan Soni
Kishan Soni

Reputation: 816

Put Images in xhdpi drawable image only and try this code :

    <ImageView
    android:id="@+id/btnring"
    android:layout_height="50dp"
    android:layout_height="wrap_content"
    android:scaleType="centerCrop"
    android:adjustViewBounds="true"
    android:src="@drawable/itayring1"
    />

Upvotes: 1

Related Questions