我有动画:
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<alpha
android:fromAlpha="0.2"
android:toAlpha="1.0"
android:duration="500"/>
</set>
和ImageView:
<ImageView
android:id="@+id/listViewIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/settings"
android:alpha="0.2"/>
和代码:
final Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
final ImageView iv = (ImageView) findViewById(R.id.listViewIcon);
anim .setFillAfter(true);
iv.startAnimation(anim);
因此,一开始我要ImageView使用alpha 0.2,而最后我要ImageView使用alpha 1。但这不是那样的-动画开始时会添加更多的alpha,动画以alpha完成0.2
我有什么改变为从动画我的形象0.2最多1?
我检查了不同的设置-我设置android:alpha="1.0",fromAlpa="1.0",toAlpha="0.2"它就像我的预期-从阿尔法1到0.2。看起来来自ImageView的alpha乘以来自动画的alpha ...
fillAfter属性:developer.android.com/reference/android/view/animation/...