从'react'导入React,{组件}从'react-native'导入{视图,样式表,文本,图像,滚动视图,动画};
类应用扩展组件{
构造函数(道具){超级(道具)this.state = {scrollY:新的Animated.Value(0)}}
使成为() {
const headerheight = this.state.scrollY.interpolate({
inputRange: [0, 100],
outputRange: [100, 0]
})
return (
<View style={styles.container}>
<Animated.View style={styles.appHeader}>
</Animated.View>
<ScrollView style={styles.scroll}
onScroll={Animated.event([{ nativeEvent: { contentOffset: { Y: this.state.scrollY } } }])}>
<View style={styles.imageView}>
<Image style={styles.image} source={require('./assets/vikalp.jpg')} />
</View>
<View>
<Text style={styles.textHeader}>Vikalp Chakravorty</Text>
</View>
</ScrollView>
</View>
);