0

我在我的项目中使用 react-native-popup-menu。代码

import React, { Component } from 'react';
import { View, Image, Text, StyleSheet, FlatList } from 'react-native';
import { icons, COLORS } from '../../../../constants'
import {
    MenuProvider,
    Menu,
    MenuOptions,
    MenuOption,
    MenuTrigger,
} from 'react-native-popup-menu';
class Areas extends Component {
    constructor(props) {
        super(props);
        this.state = {}
    }
  render() {
        return (
            <MenuProvider>
                <View style={StyleSheet.conatiner}>
                    <View style={{ display: 'flex', flexDirection: 'row', paddingVertical: 16, borderRadius: 4, backgroundColor: "#F8F9FB", marginTop: 16, paddingLeft: 8, height: 80 }}>
                        <View style={{ flex: .8 }}>
                            <Text>Al falih school</Text>

                        </View>
                        <View style={{ flex: .2, justifyContent: 'center', alignItems: 'center' }}>
                            {/* <Image style={{height:15,width:15}}  source={icons.ellipse} /> */}
                            <Menu>
                                <MenuTrigger children={<Image style={{ height: 15, width: 15 }} source={icons.ellipse} />} />
                                <MenuOptions>
                                    <MenuOption onSelect={() => {
                                    }} customStyles={{ paddingVertical: 8 }}>
                                        <Text>Delete</Text>
                                    </MenuOption>

                                </MenuOptions>
                            </Menu>

                        </View>
                    </View>
                </View>
            </MenuProvider>
        );
    }
}

const styles = StyleSheet.create({
    conatiner: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
    }
});
export default Areas;

输出 [![在此处输入图像描述][1]][1]

如截图菜单在触发器旁边没有弹出,如何找到菜单触发器旁边的弹出菜单?[1]:https ://i.stack.imgur.com/vJqc0.jpg

4

0 回答 0