【发布时间】:2017-12-18 11:53:44
【问题描述】:
当我对listview 的任何项目执行onPress 时,我正在尝试打开另一个屏幕。
<TouchableHighlight underlayColor={AppColors.black}
onPress={Actions.SubCategoryList(item.guid)}>
<View>
<Item style={{flexDirection: 'row', height: 50, borderBottomWidth: borderWidth}}>
<Text style={{
fontFamily: AppStyles.fontFamily,
fontSize: 17,
flex: 5,
color: AppColors.black
}}>{item.category_name}</Text>
<Item style={{flex: 1, borderBottomWidth: 0, flexDirection: 'row', justifyContent: 'flex-end'}}>
<Text style={{
color: AppColors.grey,
fontFamily: AppStyles.fontFamily,
fontSize: 17,
marginRight: 15
}}>{item.active_tournaments}</Text>
<Image resizeMode="contain" source={require('../../assets/images/right.png')}
style={{width: 15, height: 15, marginTop: 3}}/>
</Item>
</Item>
</View>
</TouchableHighlight>
但是每当我进入当前屏幕时,它直接进入子类别屏幕而不点击。
我想知道如何在另一个屏幕上捕获从当前屏幕发送的数据。
【问题讨论】:
-
使用箭头函数onPress={()=>{Actions.SubCategoryList(item.guid)}}
-
我已经试过了,但是当我说什么也没发生。
标签: react-native react-native-ios react-native-router-flux react-native-listview