Android ImageView Animation

前端 未结 9 1027
忘掉有多难
忘掉有多难 2020-12-04 07:32

I\'ve created a layout with an image view and a web view. The web view is set to have a default visibility of gone. When the activity fires up it displays the image view fir

9条回答
  •  無奈伤痛
    2020-12-04 08:25

    One way - split you image into N rotating it slightly every time. I'd say 5 is enough. then create something like this in drawable

    
        
        
        
      
    

    code start

    progress.setVisibility(View.VISIBLE);
    AnimationDrawable frameAnimation = (AnimationDrawable)progress.getDrawable();
    frameAnimation.setCallback(progress);
    frameAnimation.setVisible(true, true);
    

    code stop

    AnimationDrawable frameAnimation = (AnimationDrawable)progress.getDrawable();
    frameAnimation.stop();
    frameAnimation.setCallback(null);
    frameAnimation = null;
    progress.setVisibility(View.GONE);
    

    more here

提交回复
热议问题