Popup menu does not overlay other components in Android

偶尔善良 提交于 2019-12-24 21:36:42

问题


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>}

回答1:


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.



来源:https://stackoverflow.com/questions/47768705/popup-menu-does-not-overlay-other-components-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!