向下移动轮子并在中心旋转[钛]



我在Titanium公司开发转轮。我需要将轮子从图像的默认位置向下移动,然后在新的中心旋转轮子(向下移动后)。

我该怎么做?

这是我写的代码;但当我把它向下移动时,它不会旋转新移动的中心。

var image = Titanium.UI.createImageView({
   backgroundImage:'test.png',
   width: wheelWidth,
   height:wheelHeight,
   bottom:100
   anchorPoint:{x:0.5, y:0.5}
});

这将使图像围绕其中心旋转10度。

var animation = Ti.UI.createAnimation({
    anchorPoint : {x:0.5, y:0.5}, // Put this in only if on Android
    transform : Ti.UI.create2DMatrix().rotate(10), // amount of rotation
    duration : 2000 // Time this will take in milliseconds
});
image.animate(animation);

最新更新