动画持续时间无效,动画直接执行完成
在页面的onShow里执行动画,duration设置为10000,偶尔会出现动画直接执行完成
2 回复
Page({ data: { }, onShow(){ setTimeout(()=>{ var animation = wx.createAnimation({ timingFunction: 'linear' , }) animation.rotate(225).step({duration:1000}) this .setData({ animationData: animation.export() }) animation = wx.createAnimation({ timingFunction: 'linear' , }) animation.rotate(225).step({duration:1000,delay:1000}) this .setData({ animationData2: animation.export() }) },100) } }) |
Page({ data: { }, onReady(){ var animation = wx.createAnimation({ timingFunction: 'linear' , }) animation.rotate(225).step({duration:1000}) this .setData({ animationData: animation.export() }) animation = wx.createAnimation({ timingFunction: 'linear' , }) animation.rotate(225).step({duration:1000,delay:1000}) this .setData({ animationData2: animation.export() }) } }) |