I am creating a UIBarButtonItem and adding it to my navigation bar like so:
(void)viewDidLoad {
...
// Add the refresh button to the navigation bar
The following approach worked, see code to change width and height of the button and to add action item as well.
UIButton *imageButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 22, 22)];
[imageButton setBackgroundImage:[UIImage imageNamed:@"message_button"] forState:UIControlStateNormal];
[imageButton addTarget:self action:@selector(messageButtonTapped) forControlEvents:UIControlEventAllEvents];
UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:imageButton];
self.navigationItem.leftBarButtonItem = leftBarButtonItem;
Note: The target and action of the UIBarButtonItem does not apply to image view