Reputation: 16851
How do i add a small image on a UINavigationBar
? It should display in front of the title. Its small and 40X40
pixel in size.
noteL: I don't want to add an image
to the background
to add this tiny image. Furthermore this should work for both iOS4 and 5
Upvotes: 0
Views: 492
Reputation: 2705
On a Navigation bar you can set both right and left buttons like this:
UIImage * myIcon = [UIImage imageNamed:@"icon.png"];
[self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithImage:myIcon
style:UIBarButtonItemStyleBordered target:self action:@selector(someAction:)]];
To the right button just message setRightBarButtonItem
Upvotes: 1