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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top