Hi,
I want to customize a UIBarButtonItem's background. Here's the code I use:
UIButton *button = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
[button setBackgroundImage:[UIImage imageNamed:@"ButtonBackground.png"] forState:UIControlStateNormal];
[editButton setCustomView:button]; // editButton is the UIBarButtonItem
Unfortunately, this doesn't work. Instead of showing the UIBarButtonItem, it simply vanishes (it becomes 100% transparent). When I leave out the setCustomView method, the UIBarButtonItem appears, but is not customized.
How can I solve this problem?
Thanks!
Rich