Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nav] Add support for bar button icons and left buttons #263

Closed
wants to merge 1 commit into from

Conversation

ide
Copy link
Contributor

@ide ide commented Mar 26, 2015

NavigatorIOS supports four new properties:

  • rightButtonImageSource: The source of an image to display in the top right. This must be a static image since UINavigationController only supports UIImages. Adding support for UIImageViews (or arbitrary views) is more complicated because custom views do not fade on touch and do not have hit slop the same way that UIImage buttons do. Usage: rightButtonImageSource: ix('ImageName')
  • backButtonImageSource: Use a custom image for the back button. This does not replace the back caret (<) but instead replaces the text next to it.
  • leftButtonTitle: Text for the left nav button, which supersedes the previous nav item's back button when specified. The main use case for this is your initial screen/UIVC which has nothing to go back to (since it is the first VC on the stack) but need to display a left button. This does hide the back button if there would have been one otherwise.
  • leftButtonImageSource: Image source for the left button, supersedes the left button title.

Added UIExplorer example to demonstrate.

@ide ide force-pushed the nav-buttons branch 2 times, most recently from 7bbe3f7 to 63dbe44 Compare March 31, 2015 19:53
@@ -1123,6 +1123,12 @@ - (NSDictionary *)customBubblingEventTypes
@"captured": @"onNavigationCompleteCapture"
}
},
@"topNavLeftButtonTap": @{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should migrate these out of RCTUIManager at some point - they should probably be regular event emitter stuff.

@sahrens
Copy link
Contributor

sahrens commented Apr 3, 2015

cc @ericvicenti as well.

@ide
Copy link
Contributor Author

ide commented Apr 6, 2015

Updated to use RCT_CUSTOM_VIEW_PROPERTY. I left the nav event in RCTUIManager for now, but was thinking they eventually belong in one of the RCTNav*Manager files.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 7, 2015
@ide ide force-pushed the nav-buttons branch 4 times, most recently from 0137261 to 36745d3 Compare April 15, 2015 21:00
@ReadingSteiner
Copy link

It will be awesome if this feature is merged :)

NavigatorIOS supports four new properties:

  - **rightButtonImageSource:** The source of an image to display in the top right. This must be a static image since UINavigationController only supports UIImages. Adding support for UIImageViews (or arbitrary views) is more complicated because custom views do not fade on touch and do not have hit slop the same way that UIImage buttons do. Usage: `rightButtonImageSource: ix('ImageName')`
  - **backButtonImageSource:** Use a custom image for the back button. This does not replace the back caret (`<`) but instead replaces the text next to it.
  - **leftButtonTitle**: Text for the left nav button, which supersedes the previous nav item's back button when specified. The main use case for this is your initial screen/UIVC which has nothing to go back to (since it is the first VC on the stack) but need to display a left button. This does hide the back button if there would have been one otherwise.
  - **leftButtonImageSource:** Image source for the left button, supersedes the left button title.

Added UIExplorer example to demonstrate.
@ide ide closed this in b97ce93 May 8, 2015
@ide ide deleted the nav-buttons branch May 13, 2015 22:45
mganandraj pushed a commit to mganandraj/react-native that referenced this pull request Mar 26, 2020
* remove a stale event from the native tracking queue that prevents every other click from registering

* comment change inline
jfrolich pushed a commit to jfrolich/react-native that referenced this pull request Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants