How to load AnimationDrawable from xml file

后端 未结 3 515
谎友^
谎友^ 2020-12-06 16:56

I have some custom class BitmapStorage, not attached to any View or whatever - an utility one. And I have born_animation.xml file which contains with

3条回答
  •  渐次进展
    2020-12-06 17:27

    Drawable

    
        
        
        
     
    

    Code:

    ImageView progress = (ImageView)findViewById(R.id.progress_bar);
    if (progress != null) {
        progress.setVisibility(View.VISIBLE);
        AnimationDrawable frameAnimation = (AnimationDrawable)progress.getDrawable();
        frameAnimation.setCallback(progress);
        frameAnimation.setVisible(true, true);
    }
    

    View

    
    

提交回复
热议问题