Objective-c – UINavigationBar back button skinning

objective c

how can I skin the look of the button in UINavigationBar?

Tried this
UIBarButtonItem *myToolbarItem = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"myImage.png"] style:UIBarButtonItemStyleBordered
target:self action:nil] autorelease];

Doesn't quite do it.

Thanks,
Tee

Best Answer

try to do this:

UIBarButtonItem *customItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"imageName.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(nameOfSomeMethod:)];
    self.navigationItem.leftBarButtonItem = customItem;
    [customItem release];

This will place your custom button on the left side of your navigation bar.

Cheers,
VFN