- 需求的场景描述(希望解决的问题)
能想animatheightadd.width一样提供一个动画持续效果
- 希望提供的能力
创建动画animatheightadd.height动画持续效果能展现出来
框架类型 | 问题类型 | API/组件名称 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|---|
小程序 | 需求 | Animation.height | 客户端 | 6.7.2 | 2.3.0 |
- 需求的场景描述(希望解决的问题)
能想animatheightadd.width一样提供一个动画持续效果
- 希望提供的能力
创建动画animatheightadd.height动画持续效果能展现出来
1 个回答
能制作一个代码片段吗?
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
我直接把代码给你吧 就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(),
})
}
因为你本来的view没有height这个样式,所以从null 变成一个数字。。你先设个height?
好的 谢谢,
其实我觉得这应该官方优化一下。。没height属性,就从组件当前高度开始算嘛。。
如果你不说,我根本不会想到这个问题,因为我写样式的时候除了图片 我从来不会去写高