我有一个iPad应用程序与splitViewController。在我的RootViewController中我添加了编辑项目列表和添加新项目的按钮
- (void)viewDidLoad
{
[super viewDidLoad];
self.clearsSelectionOnViewWillAppear = NO;
self.contentSizeForViewInPopover = CGSizeMake(320.0, 500.0);
// Configure the Edit button
[[self navigationItem] setLeftBarButtonItem:[self editButtonItem]];
// Configure the Add button
UIBarButtonItem * addButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(add)];
[[self navigationItem] setRightBarButtonItem:addButton];
[addButton release];
}
它工作很好。按钮水龙头。调用选择器。但是按钮看起来是不活动的(灰色)。标题也是灰色的。为什么?
我需要做什么给他们一个标准的布局?
可能是这一行。注释这行
自我。
从你的屏幕截图BarButtonItems的颜色是正确的和UISplitViewController的默认颜色。
如果你想自定义BarButtonItems的颜色,你可以通过提供tintColor来修改按钮的颜色。
addButton.tintColor = [UIColor redColor];