Android 上丰富的图像滚动和缩放
我正在寻找一种实现图像缩放和滚动的方法 Droid Comic查看器。有什么快速的方法可以做到这一点吗?如果没有,那么您至少可以提供一些关于实现动态滚动的建议吗?
I'm looking for a way to implement image zoom and scrolling the way it is implemented in Droid Comic Viewer. Is there any quick way to do that? If not, then could you please give some advices at least on implementing kinetic scrolling.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对我们来说并不快。当我们实现 Droid Comic Viewer 的这一部分时,我们使用 ScrollView 的源代码作为参考来创建一个能够处理水平和垂直滚动的视图。
滚动和缩放有很多怪癖,我们逐渐解决了,其中一些我们仍然需要解决。
如果您不着急,我们计划在今年晚些时候发布源代码。
It wasn't quick for us. When we implemented that part of Droid Comic Viewer we used the source code of ScrollView as reference to create a view able to handle horizontal and vertical scrolling.
Scrolling and zooming have a lot of quirks that we gradually solved, and some of them that we still have to solve.
If you're not in a hurry, we plan to release the source code later this year.
实现缩放的方法有很多种。最简单的方法是在 ImageView 上设置图像矩阵:
如果您不熟悉触摸事件处理,请查看 OnTouchListener。使用 GestureDetector 可以帮助进一步简化事情。
There are many ways to implement zoom. As easy way is to set an image matrix on the ImageView:
If you're not familiar with touch event processing, look into OnTouchListener. Using a GestureDetector can help simplify things further.