I have a custom UIBarButtonItem
with an image that works fine in iOS 6.1. But iOS 7 has a tintColor
and it overlays this color over my image. If I set the tintColor
to [UIColor clearColor]
the button doesn't show up all together.
How can I have my back button show up in iOS 7 as it does in iOS 6? Please help?
You should use appearance on UINavigationBar to globally set the custom back button.
[UINavigationBar appearance].backIndicatorImage = customBackButton;
[UINavigationBar appearance].backIndicatorTransitionMaskImage = customBackButton;
Try to set UIBarButtonItem
like this way in ios7:-
UIImage *temp = [[UIImage imageNamed:@"theImage"] imageWithRenderingMode: UIImageRenderingModeAlwaysOriginal];
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithImage:temp style:UIBarButtonItemStyleBordered target:self action:@selector(action)];
Here is an original post in apple Dev center discussion Forums
For supporting both version iOS7 as well as lower then you check system-version
and set code like:-
UIImage *temp=nil;
if([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0)
{
temp = [UIImage imageNamed:@"btn-back.png"];
}
else
{
temp = [[UIImage imageNamed:@"btn-back.png"] imageWithRenderingMode: UIImageRenderingModeAlwaysOriginal];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With