When I add an icon to a UIBarButtonItem
via the Interface Builder, the icon is displayed white. When I add the same icon file programmatically to another UIToolbar
, the icon is displayed black. Why?
UIImage *image = [UIImage imageNamed:@"icon.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:image forState:UIControlStateNormal];
rootViewController.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:reloadButton] autorelease];