我发现已经有人问过同样的问题,但解决方案对我不起作用。
我看不到动画。
这样调用:
Intent intent = new Intent(this, MyActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
fadein.xml 和 fadeout.xml 在 anim 文件夹中:
淡入淡出.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<alpha
android:duration="1000"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1.0" />
</set>
淡出.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:duration="1000"
android:fromAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="0.0" />
</set>
使用分钟。 API 7:
list :
<uses-sdk android:minSdkVersion="7"/>
API 7 也在我的 project.properties 文件中:
target=android-7
我做错了什么?
PD使用插值器移除线条不会改变任何内容。
已经看过/尝试过:
overridePendingTransition doesn't work
overridePendingTransition does not work when FLAG_ACTIVITY_REORDER_TO_FRONT is used
Fade in Activity from previous Activity in Android
最佳答案
问题是设备,至少在三星 Galaxy 的情况下,必须启用动画才能工作。这可以在设置菜单中完成。
关于android - overridePendingTransition 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11364714/