Skip to content

Instantly share code, notes, and snippets.

@abdurrahmanekr
Created June 11, 2017 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdurrahmanekr/f8bfce2b2f3b1d89084900d78c4bf4d8 to your computer and use it in GitHub Desktop.
Save abdurrahmanekr/f8bfce2b2f3b1d89084900d78c4bf4d8 to your computer and use it in GitHub Desktop.
javascript,react-native,animation,animated
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