Skip to content
Advertisement

I used Glide library to load image into imageView and I don’t know how to make image pinch to zoomable

JavaScript

I tried using Picasso too and then connecting it with PhotoView library but it didn’t do anything, when I tried pinch to zoom it didn’t zoom at all, here is part of that code:

JavaScript

Advertisement

Answer

You can for example use this library. https://github.com/MikeOrtiz/TouchImageView

Load your image into this widget, instead of ImageView

Sample usage:

JavaScript

Notice, that i also use SimpleTarget first, it is good practice for using Glide and pinch to zoom effect for large images.

And the layout will be something like this:

JavaScript

Also, sometimes there is an issue with loading the image after this setup. For me works something like this. I override the method from TouchImageView class:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement