Can't get to original size of image after zooming in using a PhotoView

255 views Asked by At

I use Chris Bane's PhotoView to display ImageViews. After zooming in, I can't zoom out to the originial size of the image. It seems like the borders are too small, but is there any other explanation?

xml photoview setup:

    <com.github.chrisbanes.photoview.PhotoView
        android:id = "@+id/ScreenshotPhotoView"
        android:src = "@drawable/LogoImg"
        android:layout_marginTop = "40dp"
        android:layout_marginBottom = "40dp"
        android:layout_width="320dp"
        android:layout_height="180dp"
        android:layout_gravity = "center_horizontal"
        android:scaleType = "fitCenter"
    />
1

There are 1 answers

0
Daniel Reyhanian On

Seems like the problem was the fact that I set the layout_width and layout_height attributes to specific values (320x180). Solved by changing to warp_content or match_parent.