You need to add a titleView to your navigation item, then you can add any subviews you want including your button. So just drag a UIView into the navigation item first, then your button.
How to add UIBarButtonItem to replace UINavigationBar title
-
13-10-2022 - |
Domanda
I was trying to replace title on UINavigationController
with UIButton
via storyboard. but I can't drag UIButton
to the center of UINavigationBar
.
I tried to made UIButton
programmatically and then assign to the title
property, but it shows a warning:
incompatible pointer type assigning to "NSString *" from "UIButton *"
are there any solutions to implement that?
I'm sorry for my bad english, I'm not native.
thanks for your help.
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow