Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a UIBarButtonItem to a UIToolbar with both text and an image in it?

How do I add a UIBarButtonItem to a UIToolbar with both text and an image in it? Take a look at the example image I show. It's exactly what I'm trying to do.

Here's the image

like image 350
Ethan Allen Avatar asked Oct 05 '11 06:10

Ethan Allen


1 Answers

First of all create a UIButton, with Image and title.

Then add that Button to BarButtonItem

UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:customButton];
like image 167
Satya Avatar answered Sep 27 '22 21:09

Satya