淡入淡出效果
作者:
勤劳的蚂蚁 | 来源:发表于
2020-03-11 14:12 被阅读0次 @Override
public void finish() {
super.finish();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);//如果没有这句,就失去了淡出的效果
}
}
<?xml version="1.0" encoding="utf-8"?>
fade_in :
<!-- 弹出时动画 -->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="0"
android:toAlpha="1"
android:duration="200"
android:fillAfter="true"/>
fade_out :
<?xml version="1.0" encoding="utf-8"?>
<!-- 弹出时动画 -->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:fromAlpha="1"
android:toAlpha="0"
android:duration="200"
android:fillAfter="true"/>
本文标题:淡入淡出效果
本文链接:https://www.haomeiwen.com/subject/saccjhtx.html
网友评论