开发者

How can I add a middle button in a UINavigationController?

I have a UINavigationController that has its left and right button properties set. Instead of having the title in the middle, I want to put a button there. I'm not sure how I can achieve this.

CODE:

UIBarButtonItem* titleButton = [[UIBarButtonItem alloc] 
                        in开发者_运维问答itWithTitle:symbol 
                                style:UIBarButtonItemStyleBordered 
                               target:self 
                               action:@selector(addToWatchlistButtonClicked:)];

self.navigationItem.titleView = titleButton;


Use titleView property of UINavigationItem.

self.navigationItem.titleView = button;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜