Fade effect between layouts

前端 未结 3 1249
离开以前
离开以前 2021-02-04 13:21

As by object, I would reproduce fade effect between two layout. Now I\'ve this situation:

LinearLayout l;
LinearLayout l2;

To switch between th

3条回答
  •  不知归路
    2021-02-04 13:37

    Since android 3.0 you can use

    android:animateLayoutChanges="true"
    

    in a layout in xml and any changes to this specific layouts content at run time will be animated. For example, in your case, you will need to set this attribute for the parent for the parent layout of l and l2 e.g

    
    
        
    
        ........
    
        
    
        
    
        ........
    
        
    
    
    

    Now hiding l1 and showing l2 at runtime will be animated.

提交回复
热议问题