捏合缩放图像视图的最佳方法

发布于 2024-12-05 18:47:14 字数 78 浏览 0 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

两个我 2024-12-12 18:47:14

如果您想要更细粒度的控制,您可以将 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 your onDraw calls.

It's a lot more complex but for my project it turned out to be the best solution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文