Skip to content

Instantly share code, notes, and snippets.

@alexkuttig
Created March 24, 2018 16:19
Show Gist options
  • Save alexkuttig/f9026c785cc206c9a954dac33c7bc995 to your computer and use it in GitHub Desktop.
Save alexkuttig/f9026c785cc206c9a954dac33c7bc995 to your computer and use it in GitHub Desktop.
if (Platform.OS === 'ios') {
let titleOpacity = this.state.scrollY.interpolate({
inputRange: [0, 41, 48],
outputRange: [0, 0, 1],
extrapolate: 'clamp'
});
let borderBottomColor = this.state.scrollY.interpolate({
inputRange: [56, 57],
outputRange: ["#ffffff", '#f2f2f2'],
extrapolate: 'clamp'
});
return (
<Animated.View style={[styles.iOSTitleContainer, {
height: this.headerHeight,
opacity: titleOpacity,
borderBottomColor: borderBottomColor
}]}>
<Text style={styles.iOSTitle}>
{title}
</Text>
</Animated.View>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment