How to implement zoom effect for image view in android?

后端 未结 9 1407
日久生厌
日久生厌 2020-11-30 20:13

I have to implement image zooming, I have tried with so many codes.But i didnt get full idea of gesture events. I want to implement when we apply double tap, image will be z

9条回答
  •  遥遥无期
    2020-11-30 20:36

    I hope you are doing well.it often happens with all when they want to add new functionality in your app then normally they all search for libraries which are not good tactic because you don`t know what kind of code is in that libabry. so I always prefer to fork the libraries and add the useful classes and methods in my application code.

    so when I stuck with the same issue, I make lots of much R&D then I find a class which gives the ability to zoomIn ,zoomOut and pinIn and out. so you can see that class here..

    so as I told before, it is a single class. so you can put this class anywhere in your projects like utils folder.and put below lines into your XML files like:

     
    

    and you can find that image view in your respected activity, as you did for all views like -:

    TouchImageView tv=(TouchImageView)findViewById(R.id.frag_imageview); 
    tv.setImageResource(R.drawable.ic_play);
    

    that's it for TouchImageView. enjoy our code :)

提交回复
热议问题