How do I add UIImage to center of UINavigationBar?

后端 未结 2 851
感动是毒
感动是毒 2021-02-20 13:39

My problem is that I have an image with width = 44 and height = 44. This method didn\'t work properly.

[self.navigationController.navig         


        
2条回答
  •  甜味超标
    2021-02-20 14:12

    Using Swift :

    var titleView = UIImageView(image: UIImage(named: "nameOfTheImage.ext"))
    self.navigationItem.titleView = titleView
    

提交回复
热议问题