【发布时间】:2014-03-28 09:18:05
【问题描述】:
我正在尝试应用 淡入淡出效果 以使所有屏幕变暗,就像提示对话框组件时一样,但我的屏幕在动画时变成白色而不是黑色。我将动画应用于作为所有视图的父级的 LinearLayout。动画代码如下:
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="1.0" android:toAlpha="0.25" android:duration="500" android:fillAfter="true"/>
以及执行:
relcontrol.startAnimation(AnimationUtils.loadAnimation(this, R.anim.foregroundanim));
它对白色产生淡入淡出效果....为什么?
【问题讨论】:
-
你提到了你的动画根视图,对吧?只需将其再次包装在另一个 viewGroup 中,然后为其设置动画
-
可能是因为你的主题很轻??
-
是的,我的主题是:@style/Theme.Sherlock.Light.NoActionBar ...但我认为如果我想要 NoActionBar 则无事可做导致层次结构
标签: android animation fade alpha animationutils