//当这么设置的时候,打开Acticity的时候会黑屏一下
overridePendingTransition(R.anim.activity_open,0);
//改成如下代码 完美解决问题
//设置打开Activity时的动画
overridePendingTransition(R.anim.activity_open,R.anim.activity_stay);
activity_open.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="100%"
android:toXDelta="0%"
android:duration="300"
/>
</set>
activity_stay.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:fromAlpha="1"
android:toAlpha="1"
android:duration="300"
/>
</set>
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/tndroid/article/details/47446423