UIBarButtonItem is blue instead of image

前端 未结 3 1362
既然无缘
既然无缘 2021-01-14 08:52

Here is what I have in my viewDidLoad method:

self.navigationController?.navigationBar.backIndicatorImage = UIImage(named: \"back\")
self.navigationControlle         


        
3条回答
  •  一生所求
    2021-01-14 09:19

    You can use renderingMode for your custom image with AlwaysOriginal mode. See below code for solved it.

    self.navigationController?.navigationBar.backIndicatorImage = UIImage(named: "back")?.imageWithRenderingMode(.AlwaysOriginal)
    self.navigationController?.navigationBar.backIndicatorTransitionMaskImage = UIImage(named: "back")?.imageWithRenderingMode(.AlwaysOriginal)
    

    Hope that helps!

提交回复
热议问题