سؤال

My first view is a UINavigationController with a rootview, which correctly shows a NavigationBar in IB in the .storyboard. I think this is nice when I am designing in IB, so I know the proportions, since the view is getting a little smaller with a navigationbar. This navigationbar from the navcontroller is pushed on all views in my app, but in IB the bar doesn't show, making it hard to figure out how it's going to look. I have chosen 'inferred' which I thought ment the NavController should automatic implement it, it is ok to just choose 'navigationcontroller' as the top bar in the Simulated Metrics? In some of my viewcontrollers the navigationbar is there, and all settings are 'inferred'.

Thanks.

هل كانت مفيدة؟

المحلول

In each viewController in the StoryBoard file in the Attributes Inspector are several drop down menus.

One of them is "Top Bar".

If this is set to "Inferred" then the navBar will show only if it's parent view shows the navbar (parent as in the view that segues to it).

Somewhere in your hierarchy will be one that has the Top Bar option set to None (or possibly all of them).

Anyway, if you change this it will show the Top Bar in the IB.

HTH.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top