简体   繁体   English

捏放大图像视图的最佳方法

[英]the best way to pinch to zoom an imageview

What is the best way to pinch-to-zoom an imageview in Android, because i've been searching this for a long long time. 在Android中缩小图像视图的最佳方法是什么,因为我已经搜索了很长时间。 Is there some tutorial, or example ? 是否有一些教程或示例? I just want some tips to guide me in the right direction. 我只希望一些提示可以指导我正确的方向。

If you want more fine grained control you can subclass ImageView handle the touch events and directly manipulate the matrix of the canvas backing it during your onDraw calls. 如果需要更精细的控制,则可以在ImageView的子类中处理触摸事件,并在onDraw调用期间直接操作支持它的画布矩阵。

It's a lot more complex but for my project it turned out to be the best solution. 它要复杂得多,但对我的项目而言,它却是最好的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM