starcode
starcode
  • 发布:2019-07-07 09:18
  • 更新:2019-07-07 09:18
  • 阅读:821

动画旋转不稳定

分类:nvue

开始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();
},

2019-07-07 09:18 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复