Wednesday, 28 August 2013

UIBarButtonItem appearance setTintColor not working in iOS7 simulator

UIBarButtonItem appearance setTintColor not working in iOS7 simulator

I am using two barButtonItems in my app and setting the barbuttonItems to
black colour like in code given below. This is working fine in ios 6.1
simulator but when I run the same code with ios7 simulator,
leftBarbuttonItem comes greyed out and rightBarButtonItem comes black as
required.
I have read one post similar to this , but not able to get a convincing
answer. Uinavigation set tintcolor tested in ios7 not working? I am also
not able to trace out why this is happening for one button and not for
other. Also how same code is working with iOS6 simulator and not iOS7
simulator. Not much help is available for iOS 7 simulator issues, if
anybody can help.
UIBarButtonItem *logoutButton = [[UIBarButtonItem alloc]
initWithTitle:@"LogoutText" style:UIBarButtonItemStyleBordered target:self
action:@selector(logoutOrCancel:)]; [[UIBarButtonItem appearance]
setTintColor:[UIColor blackColor]];
UIBarButtonItem *otherButton = [[UIBarButtonItem alloc]
initWithTitle:@"SomeText" style:UIBarButtonItemStyleBordered target:self
action:@selector(someAction:)];

No comments:

Post a Comment