Frage

Is it possible to set a matrix onto a ViewGroup or Layout so that all children are automatically affected? For instance, if you got a layout like this:

  1. MainActivity - RelativeLayout
    • ViewGroup - RelativeLayout
    • ImageView
    • LayeredDrawable

So it should be possible to implement Zoom/Pan in the ViewGroup so that both, the ImageView and the LayeredDrawable (children of the ViewGroup) are affected. I want to avoid using View.OnDraw (that is used in ALL examples on pinch-zoom).

Any idea?

War es hilfreich?

Lösung

check getChildStaticTransformation http://developer.android.com/reference/android/view/ViewGroup.html#getChildStaticTransformation(android.view.View,android.view.animation.Transformation) It's a callback that gets called for every child of a viewgroup and allows you to set a transformation to the child

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top