1
我使用自定义图像作为我的导航栏按钮使用下面的代码,使我可以自定义添加按钮。我希望能够为编辑按钮项目执行相同的操作。iphone自定义导航栏编辑按钮
UIImage *image=[UIImage imageNamed:@"Plus.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
[button setBackgroundImage:image forState:UIControlStateNormal];
[button addTarget:self action:@selector(add) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.rightBarButtonItem = barButtonItem;
[barButtonItem release];
self.navigationItem.leftBarButtonItem = self.editButtonItem;
,因为我想改变按钮文本color.I会感谢你的帮助,我这样做,
萨拉