Android ImageView Animation

前端 未结 9 1059
忘掉有多难
忘掉有多难 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 07:59

    Don't hard code image bounds. Just use:

    RotateAnimation anim = new RotateAnimation( fromAngle, toAngle, imageView.getDrawable().getBounds().width()/2, imageView.getDrawable().getBounds().height()/2);
    

提交回复
热议问题