当我通过Interface Builder向UIBarButtonItem
添加图标时,图标会以白色显示。但是当我以编程方式将相同的图标文件添加到另一个UIToolbar
中时,图标会以黑色显示。为什么?
UIImage *image = [UIImage imageNamed:@"icon.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:image forState:UIControlStateNormal];
rootViewController.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:reloadButton] autorelease];