Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top