Reputation: 15138
I have a UINavigatorBar and dropped a button to the left top corner in the Interface Builder.
Simple question: The Button is round, how I can set the button to a "back-style" button? (I mean, that the left side of the button is not round, it should be a arrow).
Upvotes: 2
Views: 1542
Reputation: 56948
I just put together a simple UIViewController
subclass that adds a customizable back button that allows you to change text colors. It basically adds some willAppear
/willDisappear
logic to animate the back button the way the UINavigationController
does while using the leftBarButtonItem
property. You'd just have to swap out the back-button PNG and change your colors in a subclass.
https://github.com/typeoneerror/BBCustomBackButtonViewController
Upvotes: 3
Reputation: 2441
If you want the back button to go back to the last view in the hierarchy, just leave the button off of the top left corner, and it should show up automatically.
Otherwise, you may need to subclass UIBarButtonItem.
Upvotes: 1
Reputation: 150605
I think if you want to do this with a UINavigationBar that does not work in conjunction with a UINavigationController you need to create a custom view for the button that is shaped like the back button.
Upvotes: 1