I can add a titleView to my navigation element very easily in code:
UIImageView *navImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"nav_logo"]]; UIView *titleView = [[UIView alloc] initWithFrame:navImageView.frame]; [titleView addSubview:navImageView]; self.navigationItem.titleView = titleView;
However, I try to do this in my storyboard, and I fail.
Here is what I did:
- Drag and drop a UIView over my VC navigation element.
- Drag UIImageView on top of UIView
- Add width / height / lead / top restrictions
- Set image property to UIImageView
I also set my UIView's background to red (well, well, more like a burnt orange) to illustrate the problem.
Here's how things look:

I am surprised that it was so difficult. Any ideas?
ios objective-c uistoryboard uinavigationitem uiimageview
djibouti33
source share