react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[V2] Android - setting leftButton doesn't work

Open adamgrossman opened this issue 7 years ago • 8 comments

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

adamgrossman avatar Dec 14 '18 01:12 adamgrossman

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

narodejesus avatar Dec 15 '18 14:12 narodejesus

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

adamgrossman avatar Jan 09 '19 21:01 adamgrossman

any workarounds for this issue?

kabus202 avatar Jan 14 '19 18:01 kabus202

Any updates?

mromarreyes avatar Feb 04 '19 19:02 mromarreyes

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.

rejjer avatar Feb 27 '19 15:02 rejjer

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.

stale[bot] avatar Mar 29 '19 16:03 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Apr 05 '19 17:04 stale[bot]

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

FernandoTN avatar May 16 '19 23:05 FernandoTN