문제

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