RN animated缩放动画
效果图:

代码:
import React, {Component} from 'react';
import {
AppRegistry,
StyleSheet,
Text,
Animated,
TouchableOpacity,
View
} from 'react-native';
export default class AnimationSpringScene extends Component {
constructor(props) {
super(props);
this.springValue = new Animated.Value(0.3)
}
componentDidMount() {
this.spring()
}
spring() {
this.springValue.setValue(0.3)
Animated.spring(
this.springValue,
{
toValue: 1,
friction: 1
}
).start()
}
render() {
return (
<View style={styles.container}>
<Animated.Image
style={{width: 227, height: 200, transform: [{scale: this.springValue}]}}
source={{uri: 'https://s3.amazonaws.com/media-p.slid.es/uploads/alexanderfarennikov/images/1198519/reactjs.png'}}/>
<TouchableOpacity onPress={() => this.spring()} style={styles.button}>
<Text>启动动画</Text>
</TouchableOpacity>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: 20,
justifyContent: 'center',
alignItems: 'center',
},
button: {
marginTop: 20,
backgroundColor: '#808080',
height: 35,
width: 140,
borderRadius: 5,
justifyContent: 'center',
alignItems: 'center',
},
});
RN animated缩放动画的更多相关文章
- RN animated组动画
代码: export default class AnimationGroupScene extends Component { constructor() { super() ) ) ) } com ...
- 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. ...
- POP缩放动画
POP缩放动画 效果 源码 https://github.com/YouXianMing/Animations // // SpringScaleViewController.m // Animati ...
- UILabel的缩放动画效果
UILabel的缩放动画效果 效果图 源码 https://github.com/YouXianMing/Animations // // ScaleLabel.h // Animations // ...
- UITableView的headerView展开缩放动画
UITableView的headerView展开缩放动画 效果 源码 https://github.com/YouXianMing/Animations // // HeaderViewTapAnim ...
- iOS项目开发实战——制作视图的缩放动画
视图的大小应该是随时可控的.今天我们就来实现对一个View的缩放动画.该动画的实现与位移动画,透明度动画稍有不同. 详细实现例如以下: import UIKit class ScaleViewCont ...
- Android实现Layout缩放动画
最近看到Any.do的缩放效果很酷,看到一篇讲Layout缩放动画实现的文章,记录一下: http://edison-cool911.iteye.com/blog/704812
- 动画--问题追踪:ImageView执行缩放动画ScaleAnimation之后,图像显示不全的问题。
http://www.bkjia.com/Androidjc/929473.html: 问题追踪:ImageView执行缩放动画ScaleAnimation之后,图像显示不全的问题., 问题:我有一个 ...
随机推荐
- DapperExtensions and Dapper.Contrib在表构架不是默认dbo时的处理 DapperExtensions and Dapper.Contrib with non-dbo Schema
什么是数据库的Schema dbo是一个构架(schema),与sql2000不同的是,在sql2005中,表的调用格式如下:"数据库名.构架名.表名",同一个用户可以被授权访问多 ...
- Centos7 防火墙常用配置及说明
一. Centos7和Centos6 防火墙的区别: 使用的工具不一样了.Centos6 使用的是iptables ,Centos7 使用的是filewall iptables 用于过滤数据包,属于网 ...
- iOS mac终端下的SQL语句
本文转载至 http://blog.csdn.net/majiakun1/article/details/41281801 我们都知道数据库的创建可以借助图形化的数据库工具软件,但也可以在Mac终端下 ...
- 【react】---context的基本使用新版---【巷子】
一.全局定义context对象 globalContext.js import React from "react"; const GlobalContext = React.cr ...
- Flask web开发之路七
今天写SQLAlchemy数据库 首先介绍ORM的概念: ORM,Object类,Relationship:关系,Mapping:映射,也就是模型关系映射 flask-sqlalchemy是一套ORM ...
- 洛谷 P1223排队接水【贪心】
题目描述 有n个人在一个水龙头前排队接水,假如每个人接水的时间为Ti,请编程找出这n个人排队的一种顺序,使得n个人的平均等待时间最小. 输入输出格式 输入格式: 输入文件共两行,第一行为n:第二行分别 ...
- [No0000100]正则表达式匹配解析过程分析(正则表达式匹配原理)&regexbuddy使用&正则优化
常见正则表达式引擎引擎决定了正则表达式匹配方法及内部搜索过程,了解它至关重要的.目前主要流行引擎有:DFA,NFA两种引擎. 引擎 区别点 DFA Deterministic finite autom ...
- window.onresize监听事件
window.onresize监听事件 onresize 事件会在窗口或框架被调整大小时发生. 支持onresize的标签:<a>, <address>, <b>, ...
- CSS:概念和三种样式
简介: CSS(Cascading Style Sheets):层叠样式表,它用来控制HTML标签的样式,给网页结构穿衣服~ CSS的编写格式是键值对的形式 -> 格式:属性名 : 属性值: ...
- flannel
Docker跨主机容器间网络通信实现的工具有Pipework.Flannel.Weave.Open vSwitch(虚拟交换机).Calico实现跨主机容器间的通信.其中Pipework.Weave. ...