react-native-动画
来源:互联网 发布:ubuntu切换到windows 编辑:程序博客网 时间:2024/06/05 07:46
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, { Component } from 'react';import { AppRegistry, StyleSheet, Text, View, CameraRoll, Animated, Easing} from 'react-native';export default class D20170502 extends Component { constructor(props){ super(props); this.state = { opacity:new Animated.Value(0), rotation:new Animated.Value(0), fontSize:new Animated.Value(0) } } componentDidMount() { var timing = Animated.timing; var _this = this; //同步执行 // Animated.parallel(['opacity','rotation','fontSize'].map(data => { // // return timing(_this.state[data],{ // toValue:1, // duration:2000, // edsing:Easing.linear // }); // })).start(); //并列执行 Animated.sequence(['opacity','rotation','fontSize'].map(data => { return timing(_this.state[data],{ toValue:1, duration:2000, edsing:Easing.linear }); })).start(); } // componentDidMount(){ // Animated.timing(this.state.opacity, // { // toValue:1, // duration:5000, // easing:Easing.linear // } // ).start(); // } render() { return ( <Animated.View style={[styles.container,{ opacity:this.state.opacity, transform:[ { rotateZ:this.state.rotation.interpolate({ inputRange:[0,1], outputRange:['0deg','360deg'] }) } ] }]} > <Animated.Text style={{ fontSize:this.state.fontSize.interpolate({ inputRange:[0,1], outputRange:[12,30] }) }} > {'这是内容'} </Animated.Text> </Animated.View> ); }}const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, },});AppRegistry.registerComponent('D20170502', () => D20170502);
阅读全文
0 0
- React Native 之 动画
- 详解React Native动画
- 详解React Native动画
- [React Native]动画-LayoutAnimation
- [React Native]动画-Animated
- React Native动画-Animated
- React Native LayoutAnimation动画
- React Native Animated动画
- react-native-动画
- React Native 动画 ---Animated
- react native动画
- react-native-Art动画基础
- react-native-Art动画基础
- React Native Animated 动画详解
- React Native动画Animated详解
- React Native 学习之动画
- react-native动画的坑
- react-native-Art动画基础
- LeetCode 409. Longest Palindrome
- TF/06_Neural_Networks/04_Single_Hidden_Layer_Network
- Go 语言并发机制初探
- 【Linux基础系列之】中断系统(2)-下半部
- IDEA 快捷键,main,sysout 模板设置
- react-native-动画
- 远程连接Ubuntu服务器的mysql出现没有权限错误的解决办法
- CXX0017:错误;没有找到index符号
- 点分治[BZOJ]2599: [IOI2011]Race
- Linux ndk编译 报错 bits/c++configure.h is not found
- 强口令策略
- Python安装模块的几种方法
- 请求合并、传输相关
- 各种编译环境中如何为C++添加命令行参数(Command-line parameter)