Resizing Image to fit Imageview

Viewed 9046

I've look at MANY questions on Stackoverflow and tried many workaround but it still didn't work.

What I wanna achieve :

enter image description here enter image description here

Yet I am achieving this :

enter image description here

This is my current xml code:

<ImageView
    android:id="@+id/image"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/text"
    android:layout_gravity="center"
    android:adjustViewBounds="true"
    android:scaleType="centerInside"
    android:src="@drawable/ic_action_search" />
4 Answers

add

<ImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_below="@+id/text"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/ic_action_search" />
Related