开发者

iphone - more than one button in leftBarButtonItem of a navigation controller

开发者 https://www.devze.com 2023-01-14 17:25 出处:网络
When I push a new view controller onto the navigation stack, the leftbarbuttonitem changes into the Title of the previous view controller, as expected. But I need to ad开发者_Python百科d an additional

When I push a new view controller onto the navigation stack, the leftbarbuttonitem changes into the Title of the previous view controller, as expected. But I need to ad开发者_Python百科d an additional button to the nav bar, just to the right of the back button. I still want the back button to work as normal. Any suggestions on how to do this?


You need to add a custom view on the navigationbar. Then, implement 2 buttons and add them on the custom view, one for back button, and one for additional button you want.

The navigationBar can be obtained by the property of UINavigationController.

Edit:
UINavigationBar class Reference, it is a sub-class of UIView.

0

精彩评论

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