How to do a fadein of an image on an Android Activity screen?

后端 未结 4 1520
别跟我提以往
别跟我提以往 2020-12-02 07:45

I\'d like to display a photo on an Android Activity screen with doing gradual and continual fade-in from pale monotone sepia to the final full color. I know how to do it on

4条回答
  •  独厮守ぢ
    2020-12-02 08:09

    Another much simpler solution is to just put a stub onClick method to your ImageView you want to fade, then inside the method you add this:

    view.animate().alpha(0).setDuration(2000);      
    
    /* Alpha attribute translates to opacity. 
    A solid View means that the alpha attribute is set to 1 (which is the 
    default) and completely invisible is 0 */
    

提交回复
热议问题