Animate ImageView from alpha 0 to 1

后端 未结 3 976
一向
一向 2021-01-27 21:21

I have an imageView that I want to start as invisible. After a certain button is clicked, I want to animate the Image into view and then I want it to remain at alpha 1. How do I

3条回答
  •  再見小時候
    2021-01-27 21:47

    You can simply set initial alpha to 0 then animate it through 1 with desired duration;

    imageView.setAlpha(0);
    
    imageView.animate()
        .alpha(1)
        .setDuration(200);
    

提交回复
热议问题