zoom in and zoom out animation in android

后端 未结 3 1533
北恋
北恋 2020-12-15 05:13

I have code of normally zoom in and zoom out animation between two activities, but I want something different. I have five buttons on my first activity if I click on first b

3条回答
  •  遥遥无期
    2020-12-15 05:31

    You can use this method after running the command to start your new activity,

    startActivity(intent);
    overridePendingTransition(animation_in_goes_here,animation_out_goes_here);
    

    Then you may replace your animations above, replacing the animation_in_goes_here with the animation resource you need for the activity that you have newly started and replacing animation_out_goes_here with the animation resource for the activity that you are leaving from. This will give you the switching effects.

    zoom_in.xml

    
    
        
     
    

    zoom_out.xml

    
    
        
    
    

    Hope this helped to answer your question.

提交回复
热议问题