新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
轉(zhuǎn)載設(shè)置Activity進(jìn)入退出動(dòng)畫
其實(shí)設(shè)置Activity動(dòng)畫的根本也就是設(shè)置View的動(dòng)畫,因?yàn)锳ctivity有一個(gè)根的View叫DecorView。

下面介紹兩種設(shè)置Activity的動(dòng)畫
1.修改Activity Theme
在styles.xml中輸入以下代碼
- [html] view plaincopy
- @anim/slideinleft
- @anim/slideoutleft
- @anim/slideinright
- @anim/slideoutright
然后在themes.xml中
- [html] view plaincopy
- @style/AnimationActivity
- true
在AndroidMainfest.xml中為Activity指定theme
2.使用代碼設(shè)定
通過調(diào)用overridePendingTransition() 可以實(shí)時(shí)修改Activity的切換動(dòng)畫。但需注意的是:該函數(shù)必須在調(diào)用startActivity()或者finish()后立即調(diào)用,且只有效一次。
網(wǎng)頁題目:轉(zhuǎn)載設(shè)置Activity進(jìn)入退出動(dòng)畫
地址分享:http://fisionsoft.com.cn/article/dpjjghp.html


咨詢
建站咨詢
