Reputation: 3850
I am trying to add UINavigationBar from Interface Builder (not storyBoard).
But, the height remains as 44.
There is one post , which has a answer but thats through code. UINavigationBar without UINavigationController
I did the same but from Interface builder But did not find working. Interface builder and simulator Screen shots are attached with this email. Also, I did add the following method in the Controller.
So, Is it possible from Interface builder?
- (UIBarPosition)positionForBar:(id<UIBarPositioning>)bar
{
return UIBarPositionTopAttached;
}
Upvotes: 1
Views: 451
Reputation: 2913
Although it may be counter-intuitive, you need to have a constraint with the value of 20
from the top of the view (The constraint should say Top Space to: Top Layout Guide). In the end it should look something like this in interface builder, but during runtime, the navigation bar will add 20 points (or pixels I'm not sure) to the top, making it stretch to the top of the screen.
Upvotes: 1