开发者

Animation while changing orientation

Is it possible to set animation when we mo开发者_Go百科ve from an activity in landscape view to an activity in portrait view ?


It's possible, but not trivial. Add this property to your <activity> in your AndroidManifest.xml file:

android:configChanges="orientation|keyboard|keyboardHidden"

Then, override your activity's onConfigurationChanged and perform the animation there.


I can give you an idea. Try to implement it this way.

  1. Add viewFlipper as a parent node in your layout and set animation to flipper.

  2. Now when you change configuration from portrait to lndscape or vice-versa, you get a call to the method onConfigurationChanged() in your activity. (you will have to overide this method).

  3. Now animate your flipper using startFlipping() and you are done.

Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜