Switch between views with crossfade animation

后端 未结 2 1433
日久生厌
日久生厌 2021-02-15 16:43

I\'ve wrote a small activity that is able to switch between two views. Now I am trying to add some animation (fade-in/fade-out effect). Can anybody explain me how to do that rig

2条回答
  •  别那么骄傲
    2021-02-15 17:12

    I think there are 2 main solution to this problem

    • The first one is using a ViewFlipper as suggested.
    • The other one is to go with the solution described here.

    I prefer the second one cause it doesn't need additional View object in your view hiearchy and second you can have your 2 view all across the view tree. Not only in a single place defined by the position of the ViewFlipper.

提交回复
热议问题