React native 当用户刷卡时获取新数据
所以我在react native中制作了一个应用程序,用户可以访问用户列表。他可以访问他所选择的用户的个人资料页面,在那里他可以找到他的名字、一点描述等等。因此,我正在寻找一种方法,当我们向右或向左滑动时,显示下一个用户和上一个用户。可能吗?目前,我只有用户配置文件React native 当用户刷卡时获取新数据,react-native,React Native,所以我在react native中制作了一个应用程序,用户可以访问用户列表。他可以访问他所选择的用户的个人资料页面,在那里他可以找到他的名字、一点描述等等。因此,我正在寻找一种方法,当我们向右或向左滑动时,显示下一个用户和上一个用户。可能吗?目前,我只有用户配置文件 _displayDetailForUser = (idUser, name, photo, age, pratique, description, distance, connected, position, principale
_displayDetailForUser = (idUser, name, photo, age, pratique, description, distance, connected, position, principale ) => {
console.log("Display user with id " + idUser);
this.props.navigation.navigate('UserProfil', { idUser: idUser, name:name, photo: photo, age:age, pratique:pratique, description:description, distance:distance, connected:connected, position:position, principale:principale });
}
render() {
return (
<View style={styles.view_container}>
<ScrollView>
<View style={styles.photo}>
<ImageBackground source={{uri:this.props.navigation.getParam('photo')}} style={{width: '100%', height: '100%'}}>
<View style={styles.photo_content}>
<LinearGradient colors={['transparent', 'rgba(0,0,0,0.5)']} style={{ position: 'absolute', left: 0, right: 0, bottom: 0, height: 80 }} />
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<View>
<Text style={{ fontSize: 50, color:'white' }}>{this.props.navigation.getParam('age')}</Text>
</View>
<View style={{ marginRight: 7, marginLeft: 7, backgroundColor: '#ffffff', width: 2, height: 30 }}></View>
<View style={{ flexDirection: 'column', flex:1 }}>
<Text style={{ fontSize: 20, fontWeight: '600', color:'white' }}>{this.props.navigation.getParam('name')}</Text>
<View style={{ flexDirection: 'row', justifyContent: 'space-between'}}>
<Text style={{ fontSize: 18, color:'white' }}>{this.props.navigation.getParam('distance')}</Text>
<Text style={{ fontSize: 18, color:'white'}}>{this.props.navigation.getParam('pratique')}</Text>
</View>
</View>
</View>
</View>
<TouchableOpacity style = {{position:'absolute', aspectRatio:0.6, resizeMode:'contain', height:50, width:50, right:10, top:10}} onPress = {()=> Alert.alert("Chat")}>
<Image style = {{resizeMode:'contain', height:60, width:60, right:10, top:10}} source = {require("../Images/chat-bg.png")}/>
</TouchableOpacity>
</ImageBackground>
</View>
</ScrollView>
</View>
)
}
}
\u displayDetailForUser=(ID用户、姓名、照片、年龄、惯例、描述、距离、连接、位置、原则)=>{
console.log(“显示id为“+idUser”的用户);
this.props.navigation.navigate('UserProfil',{idUser:idUser,name:name,photo:photo,age:age,pratique:pratique,description:description,distance:distance,connected:connected,position:position,principale:principale});
}
render(){
返回(
{this.props.navigation.getParam('age')}
{this.props.navigation.getParam('name')}
{this.props.navigation.getParam('distance')}
{this.props.navigation.getParam('pratique')}
Alert.Alert(“聊天”)}>
)
}
}
谢谢你的帮助 您可以使用
反应本机滑动手势
,但如何将下一个视图链接到下一个配置文件?