Вопрос

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.

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top