I am trying to figure out how I can achieve something like this:

This is a toolbar, and I would like to leave the button title text without creating the entire image with the And icon. How to add an icon to the left of UIBarButtonItem , while maintaining text with:
UIBarButtonItem *customBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Button" style:UIBarButtonItemStyleBordered target:nil action:nil];
EDIT
This is what I achieved with the following code:
UIButton *customButton = [UIButton buttonWithType:UIButtonTypeCustom]; [customButton setImage:[UIImage imageNamed:@"Test"] forState:UIControlStateNormal]; [customButton setTitle:@"Button" forState:UIControlStateNormal]; customButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0); [customButton sizeToFit]; UIBarButtonItem *customBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:customButton];

Two questions: the first is the size of UIButton , and the second is that, as you can see from the gif, the button is not animated properly when I click inside the button and when I release the tap, Any ideas?
objective-c ios7 uitoolbar uibarbuttonitem
Fred Collins Oct 05 '13 at 16:40 2013-10-05 16:40
source share