开始rotate无法循环播放,后来发现需要每次设置不同的角度。如果设置不同角度,旋转速度就不一样,忽快忽慢,怎么解决。
this.animation = uni.createAnimation({
duration:1000,
timingFunction:"linear"
});
setInterval(function () {
this.repeatRotate();
}.bind(this), 1000);
repeatRotate: function () {
let degree = Math.abs(Math.random() * 720 - 360);
this.animation.rotate(degree).step();
this.animationData = this.animation.export();
},
0 个回复