旋转图像到指定的方向

我想旋转一个箭头来指定一些指定的位置:

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();

现在是旋转,但是不到一秒又回到了原来的位置。如何让它像指南针一样旋转?


温温酱
浏览 558回答 2
2回答

波斯汪

设置 Animation 中的 Duration:animation.setDuration(1500); Where Duration is int(miliseconds)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java