Android: how to animate a viewstub?

How to inflate a performance with some animation?

+3
source share
1 answer

Call the method first inflate(), and then tweak the animation on the returned view, for example:

View view = ((ViewStub) findViewById(R.id.stub_view)).inflate();
Animation animation = AnimationUtils.makeInAnimation(this, true);
animation.setDuration(300);
view.startAnimation(animation);
+3
source

All Articles