Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Context popup menu in wix/react-native-navigation navbar

Is it possible to set three dot context menu using "react-native-popup-menu" in "react-native-navigation" navbar? or do we have any other approach to set three dot context menu in both IOS and Android with "react-native-navigation" navbar?

like image 279
ugendrang Avatar asked Oct 18 '22 05:10

ugendrang


1 Answers

You can control the priority and positioning of each button (On Android) using the showAsAction property. See the docs for more details.

In short, the following snippet will add two buttons to the menu and one outside:

static navigatorButtons = {
  rightButtons: [
    {
      id: 'btn1',
      title: 'Menu button 1'
      showAsAction: 'never'
    },
    {
      id: 'btn2',
      title: 'Menu button 2'
      showAsAction: 'never'
    },
    {
      id: 'btn3',
      title: 'Regular Button'
      icon: require('./img/button.jpeg'),
      showAsAction: 'always'
    }
  ]
);

This isn't available on iOS since on iOS an action sheet is usually used instead of a menu.

like image 107
guy.gc Avatar answered Nov 12 '22 12:11

guy.gc