Slee
Slee

Reputation: 28248

creating back arrow shaped leftBarButtonItem on UINavigationController

I have a view with a navigation controller that I am showing modally and I want to add a back button that is shaped like the default left arrow buttons used in most splitViewControllers.

I can create a basic button but I really want the left arrow shape - here is what i have now:

/* set title and nav bar items */
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Back To Thumbnails" style:UIBarButtonItemStylePlain target:self action:@selector(backToThumbnails:)] autorelease];

I only saw 3 options for style here? Any suggestions are greatly appreciated!

Upvotes: 6

Views: 5449

Answers (2)

Bittu
Bittu

Reputation: 676

Although, this seems like a small scenario, there is a open source library called Three20 which is created by the developer of the Facebook app. It has something called TTButton in there (very similar to UIButton) and one of the styles offered is the back button with arrow. Its a pretty big library, so I am not sure if it will be worth to put this in just for one thing although they do offer some very nice feature that are not available else where.

Upvotes: 0

christo16
christo16

Reputation: 4843

Unfortunately creating a button like that is not apart of the public API, you'll need to make a custom UIBarButton with an image.

Upvotes: 3

Related Questions