android 多点触控图像缩放?
我正在全屏显示图像,现在我想放大或缩小它。 有没有关于如何实现多点触摸图像缩放的指南?
我使用的是2.1 sdk版本。
I'm displaying an image on full screen now i want to zoom it in or out.
Any one guide on how I can implement multi touch image zooming?
I am using the 2.1 sdk version.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
可以使用 webview 来显示本地文件。 Webview 集成了多点触控缩放功能。看看我关于此主题的问题。
There is the possibility to use a webview to display a local file. The Webview has integrated multitouch zooming. Have a look at my question regarding this topic.
我有一个 2.1+ WebView 解决方案的工作实现
,在 4.0.x 上给我带来了问题(出现了很多奇怪的空格)
https:// github.com/jasonpolites/gesture-imageview
可能对某人有用......
I have a working implementation for 2.1+
WebView solution caused problems for me on 4.0.x (lot's of weird white spaces appearing)
https://github.com/jasonpolites/gesture-imageview
Might be useful for someone...
Android 开发者博客上的最新帖子包括一个完全符合您要求的示例。不幸的是,它依赖于首次出现在 Froyo 中的 ScaleGestureDetecter。
A recent post on the Android Developers Blog includes an example that does exactly what you ask. Unfortunately, it relies upon ScaleGestureDetecter which makes its first appearance in Froyo.
您是否尝试过使用意图“android.intent.action.VIEW”并让手机内置的图像查看器显示您的图像?如果手机支持的话,它可能会使用多点触控。
http://developer.android.com/reference/android/content/Intent .html#ACTION_VIEW
Have you tried using the intent "android.intent.action.VIEW" and letting the phone's built in image viewer display your image? It will probably use multi-touch controls if the phone supports it.
http://developer.android.com/reference/android/content/Intent.html#ACTION_VIEW
关于gesture-imageview库:
https://github.com/jasonpolites/gesture-imageview
它实际上很有用,但不幸的是它有一些错误,例如:
https://github.com/jasonpolites/gesture-imageview/issues/37
无论如何,值得尝试的好库。它解决了我的用例。
Regarding gesture-imageview lib:
https://github.com/jasonpolites/gesture-imageview
it's in fact useful, but unfortunatelly it has some bugs, like:
https://github.com/jasonpolites/gesture-imageview/issues/37
Anyway, good lib to try. It solved my usecase.