如何计算上下文菜单的位置?

时间:2018-08-02 12:01:04

标签: react-native-popup-menu

上下文菜单远低于应有的菜单。我尝试使用

<Menu renderer={Popover} rendererProps={{ placement: 'top' }} >

但是这只是微不足道的帮助。这是截图。任何帮助表示赞赏。

enter image description here

编辑:我现在使用了https://github.com/instea/react-native-popup-menu/blob/master/doc/extensions.md所示的自定义菜单。

这会将选项菜单移动到正确的位置,但会丢失所有样式,并且没有动画,也不会消失。

const CustomMenu = (props) => {
const { style, children, layouts, ...other } = props;
const position = { top: 0, right: 0 }
return (
    <View name={'newquote2'} {...other} style={[style, position]}>
        {children}
    </View>
);

};

1 个答案:

答案 0 :(得分:0)

您需要将库菜单组件与您自己的自定义菜单一起使用。例如

<Menu renderer={CustomMenu} >
相关问题