Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
338 views
in Technique[技术] by (71.8m points)

iphone - Custom image for UINavigation Back Button in iOS 7

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?

iOS 6.1

iOS 7

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should use appearance on UINavigationBar to globally set the custom back button.

[UINavigationBar appearance].backIndicatorImage = customBackButton;
[UINavigationBar appearance].backIndicatorTransitionMaskImage = customBackButton;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...