简体   繁体   中英

How to hide/ remove Default back button when pushing view controller in react native?

I am developing application using react native. I have implemented NavigatorIOS component for navigations. It works fine with push and pop navigations but It shows default back button with previous page title and back arrow. I have designs like Cancel button on right side and no back / left button. I know it is just one line code in objective-c to hide back button.

I tried on react native documents but did not found anything regarding this.

could anyone have idea about it?

Looks like there still ins't a way to hide the left/right buttons while pushing using NavigatorIOS.

A small hack that I use is setting the leftButtonTitle to a whitespace.

this.props.navigator.push({
  title: 'New Screen',
  leftButtonTitle: ' ',
  component: MyComponent,
  passProps: { id: 101 },
})

According to the docs , support for NavigatorIOS is provided by the community, not Facebook and as such the features are limited. They recommend Navigator for "non-trivial apps". You're able to fully customize the nav bar in this component, but not for NaviagatorIOS.

Includes a navigation bar by default; this navigation bar is not a React Native view component and the style can only be slightly modified.

You can always export that native view over the bridge, but that's probably more work than it's worth.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM