捏合缩放图像视图的最佳方法
在 Android 中捏合缩放图像视图的最佳方法是什么,因为我已经搜索了很长时间。有教程或者例子吗?我只是想要一些提示来引导我走向正确的方向。
What is the best way to pinch-to-zoom an imageview in Android, because i've been searching this for a long long time. Is there some tutorial, or example ? I just want some tips to guide me in the right direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
scalegestureDetector
参见此处 http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.htmlyou can use
scalegesturedetector
see here http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html如果您想要更细粒度的控制,您可以将
ImageView
子类化来处理触摸事件,并在onDraw
调用期间直接操作支持它的画布矩阵。它要复杂得多,但对于我的项目来说,它是最好的解决方案。
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 youronDraw
calls.It's a lot more complex but for my project it turned out to be the best solution.