开发者

How can I do a fade animation when the user rotates the phone?

开发者 https://www.devze.com 2023-01-16 12:36 出处:网络
My app\'s main screen is a listview in portrait mode. When it is in landscape orientation it switches to an ImageView. I want to be able to animate a 开发者_如何学编程fading transition when I switch o

My app's main screen is a listview in portrait mode. When it is in landscape orientation it switches to an ImageView. I want to be able to animate a 开发者_如何学编程fading transition when I switch orientations. How can I go about doing this?


I found a similar question: How to do a fadein of an image on an Android Activity screen?

that has the solution. Just need to make sure the animation is performed after the UI is mapped to the XML. Android kills the activity every time you rotate, so best place is onStart() or onCreate()

0

精彩评论

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

关注公众号