【发布时间】:2014-10-24 06:26:31
【问题描述】:
我有一个使用淡入淡出动画的应用程序。它在 android 4.2.2 的设备上正常工作。但是,相同的应用程序不会在设备 4.4.2 上显示动画。这些是我的 xml 文件
res/anim/fadein.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator" >
<alpha
android:duration="1000"
android:fromAlpha="0.1"
android:toAlpha="1.0" />
res/anim/fadein.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator" >
<alpha
android:duration="2000"
android:fromAlpha="1.0"
android:toAlpha="0.1" />
这就是我称之为淡出动画的地方。
animationFadeOut = AnimationUtils.loadAnimation(this, R.anim.fadeout);
aim.startAnimation(animationFadeOut);
我非常想知道为什么 4.2.2 版可以,但 4.4.2 版不行。你能帮帮我吗?
问候
【问题讨论】:
-
你在哪个设备上测试过?
-
对于 4.2.2,它是 google Galaxy nexus。对于 4.4.2,它是 nexus 5 和我的 exper t7q 品牌平板电脑。前两个是模拟器。