How to add image in UINavigationBar in IPhone app

后端 未结 3 1385
無奈伤痛
無奈伤痛 2020-12-23 17:44

In my app, i want to add image(logo) in Navigation bar. I am working on XCode 4.2 and iOS 5.

I know UINavigationBar, UIToolBar has been cha

3条回答
  •  鱼传尺愫
    2020-12-23 18:19

    Another way without using a viewController

    // Create your image
    UIImage *image = [UIImage imageNamed: @"logo.png"];
    UIImageView *imageview = [[UIImageView alloc] initWithImage: image];
    
    // set the image view to the title view
    self.navigationItem.titleView = imageview;
    

提交回复
热议问题