Reputation: 321
How do I position a full colour logo to the top right side? When I try it goes one colour. When positioning in the center I don't get that issue.
Right side makes the logo blue:
self.navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage.init(named: "inteliPOS_Iconic_Mark")
But in the title it's fine:
self.navigationItem.titleView = UIImageView(image: UIImage(named: "inteliPOS_Iconic_Mark"))
Upvotes: 0
Views: 64
Reputation: 27620
You can use a UIBarButtonItem
with a UIImageView
as custom view. That will keep the color of your image:
let logoImageView = UIImageView(image: UIImage(named: "inteliPOS_Iconic_Mark"))
navigationItem.leftBarButtonItem = UIBarButtonItem(customView: logoImageView)
If you use UIBarButtonItem(image:)
the image will be used as a template and tinted according to the navigation bar's tint color.
When you use UIBarButtonItem(customView:)
the image will be used as is.
Upvotes: 2