View with horizontal and vertical pan/drag and pinch-zoom

前端 未结 9 2035
离开以前
离开以前 2020-11-28 22:56

Is it possible to have a view who supports horizontal and vertical pan/drag. On top of that, I want to be able to pinch to zoom and double tap to zoom. Does this view exists

9条回答
  •  臣服心动
    2020-11-28 23:30

    This custom view is a subclass of the Android standard imageView and adds to it (multi)touch pan and zoom (and double tap zoom, as well):

    https://github.com/sephiroth74/ImageViewZoom

    http://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/

    It is similar to the MikeOrtiz's TouchImageView that you already know but adds some more features.

    You can use it inside a view "stack" (an Android FrameLayout or something like that) together with the other textView(s) you need. (I mean a "pile" of views, like a pile of dishes or a stack of cards. In other words, a pile of views stacked one over the next on the Z axis.)

    Moving all your views together requires that you take control of the Android Gestures (multitouch) mechanism and write the required code. There isn't any ready-to-use solution for your (quite complex) requirement. Have a look at this article:

    http://android-developers.blogspot.it/2010/06/making-sense-of-multitouch.html

提交回复
热议问题