我正在开发react-native Android Sample App。首先我创建了一个页面内的标签栏底部页面...在TabBar包含OneTabPage包含打开两个模态(一个是使用编辑和另一个日期显示到模态的自定义设计)模式和一个按钮具有EditButton当我点击editIcon显示Modal它的工作正常iOS。但是在android中,当我去点击下一个标签并回到当前页面时它不起作用模态意味着不打开(android)。
我正在关注此链接:https://github.com/bodyflex/react-native-simple-modal 这是我的代码:
<Modal
open={this.state.open}
offset={0}
animationDuration={200}
animationTension={40}
open={this.state.open}
closeOnTouchOutside={true}
modalDidOpen={() => console.log('modal did open')}
modalDidClose={() => this.setState({open: false})}
style={{flexGrow: 1,
height:windowSize.height/2.5}}>
<View style={styles.modelView}>
<View style={{flex:.25, justifyContent:'center', alignItems:'center'}}>
<Text style={{fontSize:16, fontWeight:'bold',textAlign:'center', color:'black'}}>
{this.state.product_title}
</Text>
</View>
<View style={{flex:.35, justifyContent:'center', alignItems:'center'}}>
<View style={styles.modelIncDecButton}>
<TouchableOpacity style={{flex:.15, justifyContent:'space-around', alignItems:'center'}} onPress={this.decrementMethode.bind(this)}>
<Image style={styles.incrementDecrementIcon} source={require('@images/decrementIcon.png')} />
</TouchableOpacity>
<View style={{flex:.05, justifyContent:'center', alignItems:'center'}}>
<Text style={{fontSize:16, fontWeight:'bold',textAlign:'center',color:'black'}}>
{this.state.product_quantity}
</Text>
</View>
<TouchableOpacity style={{flex:.15, justifyContent:'space-around', alignItems:'center'}} onPress={this.incrementMethode.bind(this)}>
<Image style={styles.incrementDecrementIcon} source={require('@images/incrementIcon.png')} />
</TouchableOpacity>
</View>
</View>
<View style={{flex:.15, justifyContent:'center', alignItems:'center'}}>
<Text style={{fontSize:16, fontWeight:'bold',textAlign:'center',color:'black'}}>
£ {(Math.floor(this.state.product_total * 100) / 100).toFixed(2)}
</Text>
</View>
<View style={{flex:.25, justifyContent:'center', alignItems:'center'}}>
<TouchableOpacity style={styles.updateButton} onPress={this.updateMethode.bind(this)}>
<Text style={styles.updateButtonText}>
Update
</Text>
</TouchableOpacity>
</View>
</View>
</Modal>
上面的代码我正在关注此链接: enter link description here
Thans in Advance