2016-07-10 7 views
0

フェージング私はImageViewのがスムーズに黒くしたい白い色に

これは私のコードです:

<?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:fromAlpha="0.1" 
     android:toAlpha="1.0" 
     android:duration="2000" 
     /> 
</set> 


<?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:fromAlpha="1.0" 
     android:toAlpha="0.1" 
     android:duration="2000" 
     /> 
</set> 

これら寝るのアニメーションは、私は黒にImageViewのを有効にすることができますどのように、白にImageViewのを回しますか?

答えて

3

Alphaはビューの透明度を表します。アルファ値0は不可視であり、アルファ1は完全に不透明である。あなたのコードでは、ImageViewを不透明からほとんど不可視(0.1)にアニメーション化しています。

ImageViewの背後にあるコンテンツが白であるため、白く​​なっていると思います。 ImageViewを黒い背景を持つ同じサイズのビューの中に入れてみてください。

関連する問題