import Menu, {MenuOptions, MenuOption, MenuTrigger} from 'react-native-popup-menu'; const triggerCustomStyle = { triggerOuterWrapper: { width: 50, alignItems: 'center', justifyContent: 'center', flex: 1 } }; const optionsCustomStyle = { optionsContainer: { backgroundColor: 'black', marginTop: 50 }, optionTouchable: { underlayColor: 'gray', activeOpacity: 40, }, optionWrapper: { margin: 5, }, optionText: { color: 'white', }, }; class DropdownButton extends Component { render() { return ( <Menu onSelect={(value) => alert(`User selected the number ${value}`)}> <MenuTrigger customStyles={triggerCustomStyle}> <Icon name="navicon" size={20}/> </MenuTrigger> <MenuOptions customStyles={optionsCustomStyle}> <MenuOption value={1} text="扫一扫"/> <MenuOption value={2} text="帮助"/> </MenuOptions> </Menu> ) } }