下面给出的是我的导航栏的图像,其中右栏按钮现在被禁用。但是当我禁用它时,它的文本变为白色。我不想要白色。对此的任何解决方案。
启用编辑按钮时的第一张图像。其他当编辑按钮被禁用时。在这种情况下,我们可以禁用按钮而不更改其文本颜色吗?提前谢谢了
这是用于自定义栏按钮
[[UIBarButtonItem appearance] setTintColor:[UIColor colorWithRed:253.0/255.0 green:220.0/255.0 blue:135.0/255.0 alpha:1.0]];
[[UIBarButtonItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor blackColor], UITextAttributeTextColor,
[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0], UITextAttributeTextShadowColor,
[UIFont fontWithName:@"MyriadPro-Cond_0" size:16.0], UITextAttributeFont, nil]
forState:UIControlStateNormal];
这是用于条形按钮
UIBarButtonItem *rightBarBtnEdit=[[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStyleBordered target:self action:@selector(methodEdit:)];
[rightBarBtnEdit setTag:701];
[self.navigationItem setRightBarButtonItem:rightBarBtnEdit];
这是禁用
self.navigationItem.rightBarButtonItem.enabled = NO;