how to rotate an image continuously?

前端 未结 6 1007
长情又很酷
长情又很酷 2021-01-04 08:26

I am trying to rotate this image by using a thread. what should I do?

     public class Start extends Activity {
        View base;
            Bitmap         


        
6条回答
  •  旧巷少年郎
    2021-01-04 09:07

    I know it's probably late but here's how I do a rotate animation on java code:

    RotateAnimation rotate = new RotateAnimation(
                    0, 360,
                    Animation.RELATIVE_TO_SELF, 0.5f,
                    Animation.RELATIVE_TO_SELF, 0.5f
            );
    
    rotate.setDuration(900);
    rotate.setRepeatCount(Animation.INFINITE);
    itemImage.startAnimation(rotate);
    

提交回复
热议问题