android multitouch image zooming?

时间秒杀一切 提交于 2019-11-27 05:58:07

问题


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.


回答1:


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:


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...




回答3:


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.




回答4:


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




回答5:


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.



来源:https://stackoverflow.com/questions/3055133/android-multitouch-image-zooming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!