I have image view in xml and I want to try to set image in center:
My current code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical"
>
<ImageView
android:id="@+id/imageview_fullscreen"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:scaleType="matrix"
android:src="@drawable/ic_launcher"
/>
</RelativeLayout>
I have added functionality for zoom in/out on image view -
http://stackoverflow.com/questions/15609845/add-limit-to-zoom-in-and-zoom-out-in-android
When I write above code then the image is not able to set in center with scale type matrix
. The image is set in left top side from above code.
How can I set this to center with scale type matrix
. ?