获取预旋转ImageView的布局旋转度

时间:2016-01-20 18:09:20

标签: android animation rotation imageview

我使用下面的代码来旋转ImageView:

    public void rotateMenuItemImage(ImageView img, Integer rotationDegree, Integer duration) {
            Integer currentDegree = ????
            RotateAnimation rotate = new RotateAnimation(currentDegree, currentDegree + rotationDegree, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
            rotate.setDuration(duration);
            rotate.setFillAfter(true);
            img.startAnimation(rotate);
        }

我想将旋转添加到当前旋转位置。 有没有办法获得ImageView的旋转量?

我知道我可以为包含最后一个旋转的任何ImageView使用一个变量,但是当我将这个方法用于许多不同的项目时,还有更好的解决方案吗?

任何帮助都将不胜感激。

0 个答案:

没有答案
相关问题