Android: how to animate viewstub?
Asked Answered
M

1

6

How to inflate view with some animation?

Mcdonough answered 7/3, 2011 at 23:32 Comment(0)
T
8

First call the inflate() method, then setup an animation on the returned view, like this:

View view = ((ViewStub) findViewById(R.id.stub_view)).inflate();
Animation animation = AnimationUtils.makeInAnimation(this, true);
animation.setDuration(300);
view.startAnimation(animation);
Thurber answered 1/6, 2011 at 17:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.