屬性動畫Rotation如何以中心軸旋轉
老師你好,請問如果rotaioin 如果以元素中心軸旋轉
ObjectAnimator.ofFloat(imgView,"rotation",0f,360f).setDuration(1000).start();
謝謝?
老師你好,請問如果rotaioin 如果以元素中心軸旋轉
ObjectAnimator.ofFloat(imgView,"rotation",0f,360f).setDuration(1000).start();
謝謝?
2015-01-16
舉報
2017-09-28
?? ObjectAnimator oaY=ObjectAnimator.ofFloat(imageView1, "rotationY", 0,360);
? ? oaY.setDuration(5000);
? ? oaY.start();
2016-06-16
//這個是按照某一點進行旋轉,默認是view的
? ? ObjectAnimator oaAnimator=ObjectAnimator.ofFloat(imageView1, "rotation", 0,360);
? ?
? ? //如果不指定中心點的話就是按照圖標自己的中心進行旋轉
? ? imageView1.setPivotX(100);//設置指定旋轉中心點X坐標
? ? imageView1.setPivotY(100);//設置指定旋轉中心點X坐標,注意的是這個點(100,100)是想對于view的坐標,不是屏幕的左上角的0,0位置,有了這你就可以實現和補間動畫一樣的效果
? ? oaAnimator.setDuration(5000);
? ? oaAnimator.start();
? ?
? ? //這個是以Y中心軸進行旋轉
? ? ObjectAnimator oaY=ObjectAnimator.ofFloat(imageView1, "rotationY", 0,360);
? ? oaY.setDuration(5000);
? ? oaY.start();