Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top