I am using [ImageViewTouch][1]
library to zoom a image instead of imageview.
<it.sephiroth.android.library.imagezoom.ImageViewTouch
android:id="@+id/imageweb"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:background="@drawable/bg_loading"
android:scaleType="fitCenter" />
I want to load the image on ImageViewTouch control and the width of image will auto fits my screen. How to fit only width and height both to my mobile screen?
Here when i do 3 times double tap means in 1st time its get zoomed in 2nd time also but in 3rd times its fits to height and width of the the device screen perfectly why its not fit at the time of first time.
But its not loaded fit to height and width at first time.? Please help me to sort out this issue.
I used this library classes May be i have to change here some thing.
1) [first][2]
2) [second][3]
Please Check Screenshots :
When first time its loaded automatically :
After 3 times double tap means here first and second time zoom and 3rd time its fits perfectly why its not fitted at the time of first time when imageview loaded this image.
I already tried below answers but its not works.
Thank you for support
Try to call function setDisplayType(DisplayType.FIT_TO_SCREEN) for your imageView
I had the same issue. After trying a few workarounds without success, finally solved it switching to this library: https://github.com/MikeOrtiz/TouchImageView
Taken from the example app:
In
it.sephirot.android.library.imagezoom.ImageViewTouchBase
change the linein
I think fitXY is fit with the xy coordinate
Scale type in the xml will not work. You should use the library. Scale type is set in this class, change the scale type Here go to
it.sephiroth.android.library.imagezoom.ImageViewTouch
in this class you can see
setScaleType(ScaleType.MATRIX);
change this tosetScaleType(ScaleType.FIT_XY);