【发布时间】:2019-06-20 11:47:45
【问题描述】:
我在文本点击中打开模型。模型正确打开,但在模型内部还有导航按钮已打开表单。按钮未打开表单。
'调用模型:'
renderClientName(){
return(
<View style={{marginTop:10,backgroundColor:'#ffffff'}}>
<Text style={styles.textStyle}>Client Name</Text>
<TouchableOpacity onPress={()=>{
this.setState({showClientModal:true})
}}
disabled={this.isTouchDisabled()}>
<Text style={[styles.textStyle,styles.borderStyle,this.getClientBorderColor(),
{color: (this.state.clientName === "Client Name # (mandatory)") ? '#c6c6bb' : '#000'}]}>
{this.state.clientName}
</Text>
</TouchableOpacity>
{this.renderErrorText('CN')}
</View>
);
}
'渲染模型:'
renderClientModal() {
return(
<Modal visible={this.state.showClientModal}
//onRequestClose={() => { }}
onRequestClose={() => this.setState({ showClientModal: false })}
animationType="slide">
<ClientScreen all_clients = {get_all_clients()}
onBack={()=>{this.setState({showClientModal:false})}}
onAddClient={this.addClientScreen.bind(this)}
onPressClient={this.closeModal.bind(this)}
selectClient state={this.baseState}
addClient={true} />
</Modal>
)
}
'客户端屏幕': 返回(
screen={Screen}
title={'Client'}
imageLeft={menuImage}
// showHomeIcon={true}
// onHomePress={()=>{Actions.pop()}}
showBackIcon={true}
onBackPress={()=>{Actions.pop()}}
showAddIcon = {true}
onLeftHeaderPress = {() => {Keyboard.dismiss(), this.state.Navigation.navigate('DrawerOpen'); } }
onAddPress ={() => {
>>Actions.AddClient()
// Actions.pop()
// this.routeToAddMeetingScreenForm()
// Keyboard.dismiss()
// if(applicationProperties.FirstSync === "true") {
// }
// else if(applicationProperties.FirstSync === "false"){
// this.setState({loading:false})
// Alert.alert(
// "Error",
// "Your first sync was unsuccessfull, please sync to add client",
// [
// {text: 'OK', onPress: () => console.log('OK Pressed')},
// ],
// { cancelable: true }
// )
// }
} }
// showBackIcon={true}
// onBackPress={()=>{Actions.pop()}}
/>
)
}
最后一个代码的 onAddPress 路由到 Actions.AddClient() 不起作用。
【问题讨论】:
标签: react-native react-native-router-flux