Animation alpha does not add alpha of the channel if the picture is transparent



  • Initially, ImageView is completely transparent 0.0, I am attaching animation of transparency to it, but the importance of the alpha-channel of transparency is not increasing.

    And if ImageView is initially not transparent, that is, when the alpha channel is 255 or (float)1.0, it's working well.

    How to do what ImageView would initially be transparent and then gradually became untransparent.

    <alpha
        android:duration="300"
        android:fromAlpha="0.2"
        android:startOffset="0"
        android:toAlpha="0.6" >
    </alpha>
    

    <scale
    android:startOffset="0"
    android:duration="600"
    android:fromXScale="1.0"
    android:fromYScale="1.0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:toXScale="30.0"
    android:toYScale="30.0" />

    <alpha
    android:duration="300"
    android:fromAlpha="0.6"
    android:startOffset="300"
    android:toAlpha="0.0" >
    </alpha>



  • Before you reproduce the animation, ask your animation. imageView setVisibility(View.INVISIBLE)♪ After animation, call me View.VISIBLE

    UPD

    You can try it again.

     <ImageView
            android:id="@+id/imageView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fillAfter="true"
            android:fillEnabled="true"
            android:alpha=".0"/>
    

    There'll be a completely transparent object. These are the parameters.

    android:fillAfter="true"
    android:fillEnabled="true"
    

    View should be guaranteed after animation. We need to check.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2