How to put an image in the center of navigationBar of a UIViewController?

后端 未结 7 2226
耶瑟儿~
耶瑟儿~ 2021-02-01 05:31

I have this snippet of code used in viewDidLoad of a UIViewController. I\'va no errors. Images exists. I get the background but not the image. Image is a sort of logo.



        
7条回答
  •  無奈伤痛
    2021-02-01 05:59

    You just specify it's frame by

    logoView.frame = CGRectMake(initialize frame here);
    

    Then use the following

    [self.navigationItem setTitleView:logoView];
    

提交回复
热议问题