Activity设置切换动画时黑屏问题的解决

//当这么设置的时候。打开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>

posted @ 2017-07-31 15:51  yxysuanfa  阅读(1723)  评论(0编辑  收藏  举报