RN 组件 Animated

匿名 (未验证) 提交于 2019-12-03 00:22:01
 constructor(props) {         super(props);         this.state = {  //这是动画效果             bounceValue: new Animated.Value(1)  //初始值         };     }     componentDidMount() {         // 动画结束         Animated.timing(             this.state.bounceValue,               { toValue: 1.2, duration: 1000 } //结束值         ).start();     } ・・・     render() {         return (             <Animated.Image                 style={{                     width: width,                     height: height,                     transform: [{ scale: this.state.bounceValue }] //绑定到样式属性                 }}                 source={splashImg}             />         );     }
文章来源: RN 组件 Animated
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!