user1690807
user1690807

Reputation: 25

Android animation behind other views

Developing for android I need a translate animation. That was easy, but I want the animation to go behind the other views. How can I achieve that? setZAdjustment(Animation.ZORDER_BOTTOM) does not work. It cannot be that hard...

Upvotes: 1

Views: 857

Answers (2)

Adam Ruhl
Adam Ruhl

Reputation: 31

How I solved this problem was to implement my own android.view.animation.Animation class, and overrride the applyTransformation() method. From this method I set a few of my own custom drawing variables, (X offset, etc.) and then called invalidate() on the view being animated. Note that my view as a custom view and I had all my drawing done in onDraw.

Upvotes: 0

Paola G
Paola G

Reputation: 798

I had the same problem in a RelativeLayout with an animated ImageView.

Defining/adding my animated View in the first place in/to the RelativeLayout and then the other views helped me.

Upvotes: 3

Related Questions