收藏
回答

createAnimation创建动画height的时候 没有动画效果

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 需求 Animation.height 客户端 6.7.2 2.3.0

- 需求的场景描述(希望解决的问题)

能想animatheightadd.width一样提供一个动画持续效果

- 希望提供的能力

创建动画animatheightadd.height动画持续效果能展现出来

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

1 个回答

  • 卢霄霄
    卢霄霄
    2018-09-29

    能制作一个代码片段吗?

    https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

    2018-09-29
    有用
    回复 5
    • 落叶
      落叶
      2018-09-29

      我直接把代码给你吧 就3行

      <view class='box' style='background-color:#e5e5e5;' animation='{{animatheightadd}}' data-num='1' bindtap='Changeshow'>2</view>

      animatheightadd:{},

      Changeshow(e){

      var animatheightadd = wx.createAnimation({

      duration: 10000,

      timingFunction: 'ease-in',

      })

      animatheightadd.height(600).step()

      this.setData({

      active:e.currentTarget.dataset.num,

      animatheightadd: animatheightadd.export(),

      })

      }


      2018-09-29
      回复
    • 卢霄霄
      卢霄霄
      2018-09-29回复落叶

      因为你本来的view没有height这个样式,所以从null 变成一个数字。。你先设个height?

      2018-09-29
      1
      回复
    • 落叶
      落叶
      2018-09-29回复卢霄霄

      好的 谢谢,

      2018-09-29
      回复
    • 卢霄霄
      卢霄霄
      2018-09-29回复落叶

      其实我觉得这应该官方优化一下。。没height属性,就从组件当前高度开始算嘛。。

      2018-09-29
      回复
    • 落叶
      落叶
      2018-09-29回复卢霄霄

      如果你不说,我根本不会想到这个问题,因为我写样式的时候除了图片 我从来不会去写高

      2018-09-29
      回复
登录 后发表内容