Android - Activity 切換動畫效果

摘要:Android - Activity 切換動畫效果

參考網址:

http://blog.csdn.net/bufanni12/article/details/26453725

Activity端在startActivity完後,加入以下這行,或第二個Activity finish完後,亦可加語法,只是動畫要改變參數


overridePendingTransition(R.anim.zoomin, R.anim.zoomout); 

XML

fade_in.xml


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

    <alpha
        android:duration="1500"
        android:fromAlpha="0.0"
        android:toAlpha="1.0" />

</set>

fade_out.xml


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

    <alpha
        android:duration="1500"
        android:fromAlpha="1.0"
        android:toAlpha="0.0" />

</set>