收藏
回答

animation调用多个step,在ios没有过渡动画?

 animation.translateY(-300).scale(3,3).step()
 animation.translateY(-500).step()


在开发者工具是可以的,但在真机ios没有了过渡动画,官方是不打算处理这个问题吗,这个问题我在其他帖子也看到过,但是没看到有处理结果

https://developers.weixin.qq.com/community/develop/doc/0006e8189fcfe87af75a6877d5bc00

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

2 个回答

  • Joe
    Joe
    2022-12-16

    亲测可行。除了第一个,把剩下的 step 放在 setTimeout 中。

    // 使用多个 step,在 IOS 上只执行第一个
    // 所以这里使用 setTimeout 解决该问题
    this.animation.scale(22).step()
    // this.animation.scale(1, 1).step()
    this.setData({
      animationData: this.animation.export()
    })
    
    setTimeout(() => {
      this.animation.scale(11).step()
      this.setData({
        animationData: this.animation.export()
      })
    }, 300) // 这里的延时等于第一个 step 的动画时长
    
    2022-12-16
    有用
    回复
  • +龙
    +龙
    2021-06-15

    目前做法是把scale放在translateY前,然后分别两次setData animation可以解决ios的问题

    2021-06-15
    有用
    回复
登录 后发表内容