收藏
回答

微信小程序 Animation 的问题?

this.animation.top(100).step({duration: 100})
this.animation.top(100+30).left(0).step({duration: 300,timingFunction: 'ease-out'})
this.animation.top(0).step({duration: 500,timingFunction: 'ease-in-out'})
this.animation.rotate(45).step({duration: 500,timingFunction: 'ease-in-out'})
this.setData({
    animationData: this.animation.export()
})

上述的代码第三步和第四步的效果会被合并执行

this.animation.top(100).step({duration: 100})
this.animation.top(100+30).step({duration: 300,timingFunction: 'ease-out'})
this.animation.top(0).step({duration: 500,timingFunction: 'ease-in-out'})
this.animation.rotate(45).step({duration: 500,timingFunction: 'ease-in-out'})
this.setData({
    animationData: this.animation.export()
})


可是去掉了第二步的  .left(0) 第三步和第四步的效果就正常了,会分开执行了

不晓得是什么原因

回答关注问题邀请回答
收藏

4 个回答

  • 禾店科技
    禾店科技
    2021-05-11

    解决了吗 我遇到了同样的问题

    2021-05-11
    有用 1
    回复
  • 2019-10-18

    https://developers.weixin.qq.com/s/1D9jrdmv7ZcY

    代码片段上传 谢谢

    2019-10-18
    有用
    回复
  • 卢霄霄
    卢霄霄
    2019-10-18

    做个代码片段?或者先试试 top 和 left改成 translate

    2019-10-18
    有用
    回复 5
    • 2019-10-18
      https://developers.weixin.qq.com/s/1D9jrdmv7ZcY
      2019-10-18
      回复
    • 卢霄霄
      卢霄霄
      2019-10-18回复
      有毒。。是bug吧。。可以给前面每一步加个 rotate(0)。。感觉这个API和rotate相关的问题还不少。。我之前碰见个 translate搭配rotate的执行顺序也有问题
      2019-10-18
      回复
    • 2019-10-18
      rotate(0) 每步加进去可以,数值变一次可以,变两次就出错
      2019-10-18
      回复
    • 卢霄霄
      卢霄霄
      2019-10-18回复
      进一步试了下,只要是改的transform的属性,就会被合并进去
      2019-10-18
      回复
    • 2019-10-18
      是的,加新属性的时候,一般都会出问题
      2019-10-18
      回复
  • 是小白啊
    是小白啊
    2019-10-18

    麻烦提供能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

    2019-10-18
    有用
    回复 1
登录 后发表内容
问题标签