问题
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
?
回答1:
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
来源:https://stackoverflow.com/questions/23847976/set-color-of-one-uibarbuttonitem-using-iboutlet