Darly
Darly
  • 发布:2019-08-02 10:22
  • 更新:2019-08-02 10:22
  • 阅读:6076

uni-app创建动画示例往复运动

分类:uni-app

            setInterval(()=>{  
                var animation = uni.createAnimation({  
                    duration:500,  
                    delay:0,  
                })  
                if(num === -20){  
                    num = 0  
                }else if(num ===0){  
                    num = -20  
                }  
                this.animation = animation  
                animation.translateY(num).rotate(90).step()  
                this.animationData = animation.export()  
            }, 500)```  
注意```if(num === -20){  
                    num = 0  
                }else if(num ===0){  
                    num = -20  
                }```
0 关注 分享

要回复文章请先登录注册