Вопрос

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?

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top