为了账号安全,请及时绑定邮箱和手机立即绑定

旋转图像到指定的方向

旋转图像到指定的方向

温温酱 2019-03-20 18:19:59
我想旋转一个箭头来指定一些指定的位置:float bearing = myLoc.bearingTo(mecca);       RotateAnimation rotate = new RotateAnimation(0, bearing, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);       arrow.setAnimation(rotate);       rotate.start();现在是旋转,但是不到一秒又回到了原来的位置。如何让它像指南针一样旋转?
查看完整描述

2 回答

?
波斯汪

TA贡献1811条经验 获得超4个赞

设置 Animation 中的 Duration:

animation.setDuration(1500);
Where Duration is int(miliseconds)


查看完整回答
反对 回复 2019-04-28
  • 2 回答
  • 0 关注
  • 542 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号