弹出菜单不会覆盖Android中的其他组件 [英] Popup menu does not overlay other components in Android
本文介绍了弹出菜单不会覆盖Android中的其他组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 react-native-popup-menu@0.10.0.它在 IOS 上运行良好,但不能覆盖在 android 上的另一个组件上.它在android上是不可见的.请提供任何解决方案.
I am using react-native-popup-menu@0.10.0. It works fine on IOS but cannot overlay on another component on android. It is invisible on android. Please provide any solution .
renderHeader() {<Header><MenuContext style={styles.container}>
<View>
<Menu>
<MenuTrigger customStyles={triggerStyles} onPress={() => this.setState({ opened: true })}>
<FaIcon name='ellipsis-h' size={21} color='#b1b9bc'/>
</MenuTrigger>
<MenuOptions>
<MenuOption onSelect={() => this.edit()} disabled={this.state.disabled}>
<Text style={this.state.disabled ? {color: 'lightgrey'} : {color: 'black'}}>Edit</Text>
</MenuOption>
<MenuOption onSelect={() => this.delete()} disabled={this.state.disabled}>
<Text style={this.state.disabled ? {color: 'lightgrey'} : {color: 'red'}}>Delete</Text>
</MenuOption>
</MenuOptions>
</Menu>
</View>
</MenuContext></Header>}
推荐答案
当 MenuContext
在树中不够高时,我遇到了这种情况.最终,我将它移到第一个组件的渲染函数中,作为所有内容的包装器,效果很好.
This happened to me when the MenuContext
wasn't high enough in the tree.
Eventually I moved it to the very first component's render function as the wrapper for everything, and that works great.
这篇关于弹出菜单不会覆盖Android中的其他组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文