0
votes

I have tab base application I want to add logo to the navigation bar I tried

  • (void)viewDidLoad { [super viewDidLoad];

    // add image

    UIImage *image = [UIImage imageNamed:@"test.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; self.navigationItem.titleView = imageView;

}

but no image be displayed any suggestion to solve that

best regards

2
Please check whether this helps : stackoverflow.com/a/28212994/8013132ABM

2 Answers

0
votes

Try with setting frame of UIImageView *imageView ...

imageView.frame = CGRectMake(myX,myY,muWidth,myHeight)

Let me know if you still struggle ...

0
votes

Do you have your leftBarButtonItem set? In the docs it says for titleView property of UINavigationItem: This property is ignored if leftBarButtonItem is not nil.