Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TintColor Changing on Popover Push

I'm setting the tint color of a window to an arbitrary color, then trying to over-ride this on a per-button basis, but it appears that the buttons revert to the window tint color whenever there is a segue applied on them.

Setting tint color in didFinishLaunchingWithOptions:

self.window.tintColor = [UIColor redColor];

and then my two buttons in viewDidLoad:

[self.button1 setImage:[[UIImage imageNamed:@"711-trash"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];
self.button1.tintColor = [UIColor purpleColor];

self.button2.tintColor = [UIColor blueColor];

where button1 is a custom type button and button2 is a system type button.

enter image description here

When the popover first presents, the two buttons are tinted purple and blue. But when the segue view controller is pushed, the popped, the two buttons switch to red. Is there any way to prevent this?

EDIT:

enter image description here

like image 475
PF1 Avatar asked Sep 03 '15 18:09

PF1


1 Answers

I've tried reproducing your code like this:

Storyboard & code

However everything worked as expected:

Result on simulator

So I agree with @user3779315, possibly you are setting the buttons' tint color somewhere else. Btw, additional code of your project would help to clarify the issue :-)

like image 152
Ducky Avatar answered Oct 11 '22 12:10

Ducky