使用IBOutlet设置一个UIBarButtonItem的颜色

我似乎无法在堆栈上find这个地方,因为每个解决scheme都提到了如何通过AppDelegate或通过设置外观来设置自定义外观

我所需要的只是设置一个,只有这一个UIBarButtonItem使用一个名为colorWithHexString:来自类扩展(添加到项目)的方法自定义hexColor。

我的财产:

 @property (weak, nonatomic) IBOutlet UIBarButtonItem *grNextButton; 

我想在我的.m文件中使用什么:

 grNextButton.tintColor = [UIColor colorWithHexString:@"#669900"]; 

我需要成功更改grNextButton的代码是什么?

使用这样的RGBcolor代码,希望它能解决你的问题。

 grNextButton.tintColor = [UIColor colorWithRed:255/255.0f green:50/255.0f blue:60/255.0f alpha:1.0f]; 

我使用的颜色代码是示例颜色代码,您可以从这里select适当的颜色代码