微信小程序连续旋转动画 https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-animation.html
文章地址https://www.yii666.com/article/756298.html 网址:yii666.com文章来源地址:https://www.yii666.com/article/756298.html<view animation="{{animationData}}" style="background:red;height:100rpx;width:100rpx; bottom:10px;position: absolute;"></view>
Page({
data: {
animationData: {}
},
onShow: function () {
var animation = wx.createAnimation({
duration: ,
timingFunction: 'ease',
}) this.animation = animation // animation.scale(2, 2).rotate(45).step() this.setData({
animationData: animation.export()
})
var n = ;
//连续动画需要添加定时器,所传参数每次+1就行
setInterval(function () {
// animation.translateY(-60).step()
n=n+;
console.log(n);
this.animation.rotate( * (n)).step()
this.setData({
animationData: this.animation.export()
})
}.bind(this), )
}, })