Skip to content

Instantly share code, notes, and snippets.

@rutvikbhatt9
Created May 28, 2019 05:02
Show Gist options
  • Save rutvikbhatt9/1462b45d2ada81a5c32b39ee2bd13627 to your computer and use it in GitHub Desktop.
Save rutvikbhatt9/1462b45d2ada81a5c32b39ee2bd13627 to your computer and use it in GitHub Desktop.
Setting value of Intepolate to Animated.Image
render() {
const profileImageLeft = this._getImageLeftPosition();
const profileImageTop = this._getImageTopPosition();
const profileImageWidth = this._getImageWidth();
const profileImageHeight = this._getImageHeight();
return(
<Animated.Image
style={
[styles.profileImage, {
borderRadius: (ThemeUtils.APPBAR_HEIGHT - 20) / 2,
height: profileImageHeight,
width: profileImageWidth,
transform: [
{translateY: profileImageTop},
{translateX: profileImageLeft}
]
}]}
source={profileImage}
/>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment