How to spin an android icon on its center point?

前端 未结 3 1056
野趣味
野趣味 2020-12-04 23:45

I have written the following to spin my icon on the center of the screen and instead it rotates around the upper-left corner (i.e., origin x=0, y=0 of the ImageView). It sh

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 00:19

    Try: r = new RotateAnimation(ROTATE_FROM, ROTATE_TO, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

提交回复
热议问题