ReactNative——动画学习
来源:互联网 发布:软件问题报告模板 编辑:程序博客网 时间:2024/06/04 19:01
支持的动画组件
单个动画
旋转
缩放
平移
透明度
import React, { Component } from 'react';import { Animated, StyleSheet, Text, TouchableOpacity, View } from 'react-native';export default class App extends Component { constructor(props) { super(props); this.state = { fadeAnimation: new Animated.Value(0), //设置初始值 }; } onButtonPress() { this.state.fadeAnimation.setValue(0); Animated.timing( this.state.fadeAnimation, //初始值 { toValue: 1, //结束值 duration: 2000, //时间 }, ).start(); //开始 } render() { return ( <View style={styles.container}> <Animated.Image style={{ width: 200, height: 200, opacity: this.state.fadeAnimation, }} source={{ uri: 'https://s3.amazonaws.com/media-p.slid.es/uploads/alexanderfarennikov/images/1198519/reactjs.png' }} > </Animated.Image> <TouchableOpacity onPress={() => this.onButtonPress()} style={styles.button}> <Text>开始动画</Text> </TouchableOpacity> </View> ); }}const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', },});
组合动画
自定义动画
差值估值
阅读全文
0 0
- ReactNative——动画学习
- ReactNative—学习资源
- ReactNative学习之旅(1)—跑起来第一个ReactNative项目
- [ReactNative]ReactNative学习资源整合
- ReactNative——Toast
- ReactNative从学习到放弃——准备工作
- ReactNative学习——react-native版本升级
- ReactNative学习——集成到原生android项目中
- ReactNative学习——react-native版本升级
- 记录一下学习ReactNative爬过的坑——StackNavigator
- ReactNative学习
- reactNative学习
- reactNative学习
- 学习ReactNative
- ReactNative动画(上)
- ReactNative动画(下)
- reactnative 动画实现
- ReactNative Animated动画详解
- Wannafly 牛客网 挑战赛2 A
- PullToRefreshListView
- 【bzoj 2044】三维导弹拦截(网络流)(拓扑排序)
- Sklearn-train_test_split随机划分训练集和测试集
- leetcode 25. Reverse Nodes in k-Group
- ReactNative——动画学习
- Android 利用WindowManager实现悬浮窗
- ClassCastException
- 将两个文件的内容排序后输出到一个文件中
- 编写一个函数,返回整型数组中的第二大值
- bzoj 5071: [Lydsy十月月赛]小A的数字
- 自定义View-仿薄荷健康卷尺效果
- 机器学习_概率密度函数和似然函数
- 欢迎使用CSDN-markdown编辑器