-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[NavigatorIOS] Add ability to set custom component as title #514
Comments
We don't need this internally, but we would be happy to accept a pull request for this. What do you think about this API:
|
Nice, will look in this direction. |
What's the advantage of making it a function here? I'd default to making it a normal element-typed prop. |
how about hidden the navigation bar ? |
@spicyj If not a function, then how would you change the title for each new scene? Maybe we could put a title element on the new route object, but I'd like to make the API start to resemble the Navigator API |
Right, that makes sense. Having title as a property of the route or similar seems to make the most sense though, akin to UINavigationItem on iOS? I'm not familiar with the Navigator API, so I'll let you figure it out. :) |
@ericvicenti Is it possible to set an image/logo instead of title in the navigation bar? |
I feel like spicyj's suggestion of having a route property makes sense. I can try to explore this area if you agree @ericvicenti regarding this api. |
+1 would love this feature |
For I think it would be nice if we could start making the API for |
+1 this would be rad. |
Was looking for a feature like OP and came across this project: https://github.com/t4t5/react-native-router |
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed. |
Agreed, this would be very useful. Has anybody looked at implementing this feature? |
Just started using react native and not being able to do that is a super bummer for me since my app customizes the navigation title. Is anybody implementing this feature? |
I'm looking to implement this as a PR but I'm struggling to find the right code in react native that takes the component JSON sent over the bridge and transforms it into usable Obj C views (to be used in a new method inside RCTConvert) - any pointers? |
In the interim I'll be developing it as such:
You can then do any customisations you need in native code. If you need to pass data back to RN (e.g. on selection of a segmented control) then normal event emitters can be used. |
@lprhodes Have you got any updates on this? |
Any plans for this feature? It would be so nice to have such a feature. |
For anyone else who has this issue, I ended up using Navigator Experimental (plays really nice with Flux, Redux in our case) and implemented the Nav in React. |
Sorry for leaving this so long - I've ended up using https://github.com/wix/react-native-navigation and https://github.com/wix/react-native-controllers. I'm sure this is heavily debated elsewhere but for me the idea of React Native was to use native components (as per above)...not a non-native feeling replacement (Navigator Experimental) |
@facebook-github-bot label Icebox |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/navigatorios-add-ability-to-set-custom-component-as-title ProductPains helps the community prioritize the most important issues thanks to its voting feature. Also, if this issue is a bug, please consider sending a PR with a fix. |
@facebook-github-bot close |
@charpeni tells me to close this issue. If you think it should still be opened let us know why. |
Easily achievable with https://reactnavigation.org now. |
UIKit's UINavigationItem has a UIView property 'titleView' which allows to set custom view as a navigation bar title. Would be nice to have that in react-native.
Two ways as I see it:
So probably child component or parameter(or other way of ding it?) should be set to the instance of RCTNavItem and then RCTWrapperViewController should set it to corresponding UINavigationItem's titleView, but I don't have any idea how to convert react component to UIView.
The text was updated successfully, but these errors were encountered: