React-native-navigation: [V2] Android - setting leftButton doesn't work

Created on 14 Dec 2018  路  8Comments  路  Source: wix/react-native-navigation

Issue Description

I'm trying to set leftButtons, but it doesn't work in Android. It works fine in iOS.

Steps to Reproduce / Code Snippets / Screenshots

Here's the static options I'm setting in my component, as described in https://wix.github.io/react-native-navigation/#/docs/topBar-buttons?id=declaring-buttons-statically

static options(passProps) {
  return {
    topBar: {
      elevation: 1,
      noBorder: false,
      leftButtons: [
        {
          id: 'leftHelp',
          component: {
            name: 'SystemHelp'
          },
        },
      ],
    }
  }
}

This does not work. I do not see the button show up. However, if I set it as a rightButton, there's no issue.

static options(passProps) {
  return {
    topBar: {
      elevation: 1,
      noBorder: false,
      rightButtons: [
        {
          id: 'leftHelp',
          component: {
            name: 'SystemHelp'
          },
        },
      ],
    }
  }
}

What am I doing wrong? Can I not set leftButtons in Android?


Environment

  • React Native Navigation version: Tried a couple, but currently on 2.2.1-snapshot.61
  • React Native version: 0.57.0
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Device - Galaxy S7
馃彋 stale

Most helpful comment

This is still an issue for me, i can not set a left button in Android. Not even an icon button.

All 8 comments

Textual left button is also not supported on Android. Only icon buttons are supported as left buttons on Android.

https://github.com/wix/react-native-navigation/issues/3982#issuecomment-422455420

thanks @narodejesus but icon buttons aren't working either - https://github.com/wix/react-native-navigation/issues/4448

any workarounds for this issue?

Any updates?

As a temporary solution, you can add a custom title component to the navbar, and display custom buttons in it, to the left of the text.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

The issue has been closed for inactivity.

This is still an issue for me, i can not set a left button in Android. Not even an icon button.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

birkir picture birkir  路  3Comments

yayanartha picture yayanartha  路  3Comments

kiroukou picture kiroukou  路  3Comments

bdrobinson picture bdrobinson  路  3Comments

zagoa picture zagoa  路  3Comments