0

I can't seem to find this anywhere on stack because every solution just mentions how you can set your custom appearance through AppDelegate or through setting the appearance.

All I need is to set ONE and only this one UIBarButtonItem to a custom hexColor using a method called colorWithHexString: that comes from a class extension(added to the project).

my property:

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

what I'm trying to use in my .m file:

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

What is the code that I need to successfully change grNextButton?

Chizx
  • 351
  • 2
  • 5
  • 16
  • @Chizx What is wrong with using `tintColor`. What is the behavior you are seeing? Also, what is the content of this button? Is it text, an image, or a custom view? – Dima May 24 '14 at 18:06
  • The button is just a `UIBarButtonItem` that has been added to the top navigation bar appropriately at the upper right hand corner and I can't seem to set it's tintColor... no change is detected :/ – Chizx May 26 '14 at 01:43

1 Answers1

0

Use RGBcolor code like this, hope it will solve your problem.

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

The color code I used are example color code you can choose your appropriate color code from here

Gajendra Rawat
  • 3,673
  • 2
  • 19
  • 36