如何通过在 React Native 中按下按钮来创建弹出菜单
How to create a popup menu by pressing a button in react native
我是菜鸟,我想在按下按钮时创建一个弹出窗口,如下图所示。我尝试了几件事但失败了。
react-native-options-menu 是一个很好的库。
https://github.com/izzisolomon/react-native-options-menu
npm install react-native-options-menu --save
//use it like so or refer to docs in github link about
<OptionsMenu
customButton={(
<View style={styles.optionsMenu}>
<SimpleLineIcons
name="options-vertical"
size={26}
color={Colors.tabIconDefault}/>
</View>
)}
destructiveIndex={1}
options={buttons.names}
actions={buttons.actions}/>
我是菜鸟,我想在按下按钮时创建一个弹出窗口,如下图所示。我尝试了几件事但失败了。
react-native-options-menu 是一个很好的库。
https://github.com/izzisolomon/react-native-options-menu
npm install react-native-options-menu --save
//use it like so or refer to docs in github link about
<OptionsMenu
customButton={(
<View style={styles.optionsMenu}>
<SimpleLineIcons
name="options-vertical"
size={26}
color={Colors.tabIconDefault}/>
</View>
)}
destructiveIndex={1}
options={buttons.names}
actions={buttons.actions}/>