MarksCode
MarksCode

Reputation: 8584

Navigation bar in UINavigationController too tall

I have a UIViewController embedded in a UINavigationController. I'm trying to make its navigation bar the same height as the rest of my views which have a navigation bar I dragged in (they're not embedded in a UINavigationController).

However, when I add a title and a prompt like I do for the rest this one ends up taller than the rest. Here's a picture of what I mean:

nav

The left is a UIViewController not embedded in a UINavigationController, while the right one is a UIViewController embedded in a UINavigationController. Both have a title and a prompt set to " ".

This is driving me crazy, can anybody help me get the one on the right to be the same height as the one on the left? When I delete its prompt it becomes too short.

Edit

The navigation on the left has a height of 74, it's just a dragged in navigation bar with a title and a prompt set to " ". From what I've gathered it is pretty much impossible to get it to be like this in an embedded navigation bar. When I add a prompt on the right its too tall as seen in the picture, when I remove it its too short.

Upvotes: 2

Views: 609

Answers (1)

bogen
bogen

Reputation: 10432

You have a blank prompt text set. That makes your food total height 74, but if you use the navcontroller with status bar it will be 64 total height.

enter image description here Bottom image is 74 px high total, thats a viewcontroller with Top Bar None and an embedded navbar with blank prompt. This will not be possible to obtain in a standard nav with VC setup, if you want it you have to alter the navbar height manually.

I usually just embed all VCs in a root navcontroller, i suggest you do that for your food VC as well. Then you will get the same height, but it will be 64 though

Upvotes: 1

Related Questions