How do I add UIImage to center of UINavigationBar?

后端 未结 2 830
感动是毒
感动是毒 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:02

    Try this:

    UIImageView *titleView = [[UIImageView alloc] initWithImage:myUIImage];
    [self.navigationItem setTitleView:titleView];
    

提交回复
热议问题