Created
June 11, 2017 10:24
-
-
Save abdurrahmanekr/f8bfce2b2f3b1d89084900d78c4bf4d8 to your computer and use it in GitHub Desktop.
javascript,react-native,animation,animated
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
Animated, | |
Easing, | |
View, | |
Text, | |
} from 'react-native'; | |
export default class test extends Component { | |
constructor(props) { | |
super(props); | |
this.springDegeri = new Animated.Value(0); | |
} | |
springOynat () { | |
this.springDegeri.setValue(0.3) | |
Animated.spring( | |
this.springDegeri, | |
{ | |
toValue: 1, | |
friction: 1 | |
} | |
).start() | |
} | |
render() { | |
return ( | |
<View style={{flex: 1, marginTop: 100}}> | |
<Text | |
style={{marginBottom: 100}} | |
onPress={this.springOynat.bind(this)}>Spring Yap</Text> | |
<Animated.Image | |
style={{ width: 227, height: 200, transform: [{scale: this.springDegeri}] }} | |
source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}/> | |
</View> | |
) | |
} | |
} | |
AppRegistry.registerComponent('test', () => test); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment