隐藏在 FlatList 中其他项目后面的弹出菜单

问题描述 投票:0回答:1

我有一个 FlatList,每个项目都使用react-native-popup-menu 功能在单击时显示弹出菜单。但是,仅显示菜单的顶部,其余部分隐藏在以下列表项后面。有没有办法让菜单出现在整个 FlatList 的顶部?谢谢。

react-native-popup-menu
1个回答
0
投票

与 FlatList 一起使用

CellRendererComponent={({children, style, ...props}) => {
            const zIndexStyle = {
              zIndex: slectedItem ? 10 : -1,
            };
            return (
              <Viewstyle={[style, zIndexStyle]} {...props}>
                {children}
              </View>
            );
          }}

有关更多详细信息,请在 github 上使用 Flatlist 查看此问题:[https://github.com/facebook/react-native/issues/28751][1]

© www.soinside.com 2019 - 2024. All rights reserved.