代码:

export default class AnimationGroupScene extends Component {

    constructor() {
super()
this.animatedValue1 = new Animated.Value()
this.animatedValue2 = new Animated.Value()
this.animatedValue3 = new Animated.Value()
} componentDidMount() {
this.animate()
} animate() {
this.animatedValue1.setValue()
this.animatedValue2.setValue()
this.animatedValue3.setValue()
const createAnimation = function (value, duration, easing, delay = ) {
return Animated.timing(
value,
{
toValue: ,
duration,
easing,
delay
}
)
}
Animated.parallel([
createAnimation(this.animatedValue1, , Easing.ease),
createAnimation(this.animatedValue2, , Easing.ease, ),
createAnimation(this.animatedValue3, , Easing.ease, )
]).start()
} render() { const scaleText = this.animatedValue1.interpolate({
inputRange: [, ],
outputRange: [0.5, ]
})
const spinText = this.animatedValue2.interpolate({
inputRange: [, ],
outputRange: ['0deg', '720deg']
})
const introButton = this.animatedValue3.interpolate({
inputRange: [, ],
outputRange: [-, ]
}) return (
<View style={styles.container}>
<Animated.View
style={{transform: [{scale: scaleText}]}}>
<Text>Welcome</Text>
</Animated.View>
<Animated.View
style={{marginTop: , transform: [{rotate: spinText}]}}>
<Text
style={{fontSize: }}>
to the App!
</Text>
</Animated.View>
<Animated.View
style={{top: introButton, position: 'absolute'}}>
<TouchableHighlight
onPress={this.animate.bind(this)}
style={styles.button}>
<Text>启动组动画</Text>
</TouchableHighlight>
</Animated.View> </View>
);
}
} const styles = StyleSheet.create({
container: {
flex: ,
marginTop: ,
justifyContent: 'center',
alignItems: 'center',
},
button: {
marginTop: ,
backgroundColor: '#808080',
height: ,
width: ,
borderRadius: ,
justifyContent: 'center',
alignItems: 'center',
}, });

最新文章

  1. Software Solutions CACHE COHERENCE AND THE MESI PROTOCOL
  2. C# 更新SQL Server数据库备注信息从另一数据库
  3. 去掉IE下input的叉号
  4. CAS 4.0.0RC 配置MD5验证功能
  5. 发布在IIS的网站,可以用本机IP登录访问,用localhost不可登录访问
  6. UITableView小知识点总结
  7. BZOJ 3439 Kpm的MC密码
  8. 认识Java虚拟机的内部体系结构、gc示例
  9. Unity3D脚本使用:游戏对象访问
  10. for语句,你真正搞懂了吗?
  11. 安卓开发:简单的登陆跳转_APK实现直接跳转到本CSDN博客
  12. 数据库子查询和join的比较
  13. Django富文本需要添加配置
  14. Liblinear and Libsvm-rank训练数据的bash代码
  15. 关于阿里云Centos服务器搭建Java网站不能访问的问题
  16. 解决python3.6的UnicodeEncodeError: &#39;gbk&#39; codec can&#39;t encode character &#39;\xbb&#39; in position 28613: illegal multibyte sequence
  17. mysql 移除服务,并在cmd下切换目录
  18. 记一次加载js不全报错的原因总结
  19. 股票F10
  20. 蓝桥杯 C/C++参考题目 取球概率(数学题,概率)

热门文章

  1. Hdg Remote Debug
  2. 巧妙解决windows下 copy命令不接受太长路径的问题
  3. python multiprocess pool模块报错pickling error
  4. yum 快速安装centos7 mysql5.7
  5. ThinkingInJava 学习 之 0000006 复用类
  6. Spring Boot 集成 Redis 实现缓存机制
  7. Unity3D 优化NGUI纹理
  8. NIO相关概念之Channel
  9. day_6.6 py
  10. CentOS 7.4下使用yum安装MySQL5.7.20 最简单的 (引用)