RN animated组动画
代码:
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',
}, });
RN animated组动画的更多相关文章
- RN animated缩放动画
效果图: 代码: import React, {Component} from 'react'; import { AppRegistry, StyleSheet, Text, Animated, T ...
- RN Animated透明度动画
主要代码解析: 如果我们希望吧Animated.Value从0变化到1,把组件位置从60px移动到0px,把不透明度从0编导1,就可以使用style的属性来实现 <Animated.Text s ...
- RN animated帧动画
效果图: 代码: export default class AnimationFrameScene extends Component { constructor () { super() this. ...
- iOS开发UI篇—核心动画(转场动画和组动画)
转自:http://www.cnblogs.com/wendingding/p/3801454.html iOS开发UI篇—核心动画(转场动画和组动画) 一.转场动画简单介绍 CAAnimation的 ...
- Core Animation中的组动画
实际开发中一个物体的运动往往是复合运动,单一属性的运动情况比较少,但恰恰属性动画每次进行动画设置时一次只能设置一个属性进行动画控制(不管是 基础动画还是关键帧动画都是如此),这样一来要做一个复合运动的 ...
- Vue系列之 => 使用第三方animated.css动画
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- react-native Animated, 旋转动画
Animated 仅封装了四个可以动画化的组件: View.Text.Image.ScrollView 可以使用 Animated.createAnimatedComponent()来封装你自己的组件 ...
- animated js动画示例
function fabtn(a){ $(a).find('i').addClass('animated wobble'); setTimeout(function(){ $(a).find('i') ...
- CSS属性组-动画、转换、渐变
一.动画 animation动画属性是一个简写属性,用于设置六个动画属性 aninmation-name动画名称,被调用 animation-duration完成动画需要的持续时间 animation ...
随机推荐
- 小程序渲染html的两种方法
一.使用文档自带的原生API rich-text, nodes属性直接绑定需要渲染的html内容即可,文档参见这里:https://developers.weixin.qq.com/miniprog ...
- iOS开发之--cocopods相关问题及解决方法
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default 解决办法:删除工程中的 ...
- OSG模拟鼠标事件影响操纵器
viewer->getEventQueue()->mouseButtonPress(0,0,1); viewer->getEventQueue()->mouseMotion(1 ...
- .Net Core 部署到Ubuntu 16.04 中的步骤
需要安装的工具 .Net Core Nginx反向代理服务器(相当于Windows下的IIS) Supervisor(进程管理工具) .Net Core安装方法请参阅 官方文档 安装完成后就可以在项目 ...
- DAX Editor VSIX project
DAX Editor is a Visual Studio extension that implements a language service for DAX language for SQL ...
- mui---自定义页面打开的方向
在使用MUI做APP的时候,会考虑对页面的打开方向做规定,MUI也给我们提供了很多种页面的打开方式. 具体参考: http://ask.dcloud.net.cn/question/174 MUI做A ...
- Code Labels
Code Labels Code labels are three-letter codes with which commit messages can be prefixed. CODE Labe ...
- 网络通信协议三之TCP/IP模型详解
TCP/IP模型 注:PDU:Protocol Date Unit:表示对等层之间传递的数据单位 TCP:Transmission Control Protocol:传输控制协议 UDP:User D ...
- 单链表实现n(n≥20)的阶乘
n(n≥20)的阶乘 基本要求 数据的表示和存储: 累积运算的中间结果和最终的计算结果的数据类型要求是整型--这是问题本身的要求. 试设计合适的存储结构,要求每个元素或结点最多存储数据的3位数值. 数 ...
- 闭区间套定理(Nested intervals theorem)讲解1
① ②这里用到了极限与不等关系 ③如果a≠b,那么便不会有$\lim _{n\rightarrow \infty }\left| I_n \right| =0$ ④如果还存在一点c在 内,那么同样也不 ...