Sarah92
Sarah92

Reputation: 671

UITabBarController in storyboard hides content of UITabBarItems

I am a beginner using storyboards for iOS. I have been using the tab bar controller to show my content.

When I first implemented the UITabBar I could see all the icons at the bottom of the UITabController in storyboard and I could see the UITabBarItem at the bottom of each UIViewController. Why is there now a blank grey bar? I can't seem to change the content either in storyboard. I tried adding another UITabBarController but got the same problem, it also has a dark grey bar at the bottom. However when I run the app all the icons appear. How do I fix this so I can see the UITabBarItems in storyboard or should I just try updating them programmatically instead?

UIViewController (tab bar controller view)

UITabViewController

Upvotes: 4

Views: 614

Answers (1)

E. Rivera
E. Rivera

Reputation: 10938

Showing a tab bar or not is one of the couple of simulated metrics used in Interface Builder. As such they only serve to have an idea of how your controller would look under different conditions but do not really change anything to the actual controller.

Most of the time the default Inferred option will try to deduce from the Storyboard configuration how it should look like. In your case just connect the tab bar controller to your controller through the viewControllers outlet.

In contrast, below you have some View Controller properties that change both how your controller is previewed in Interface Builder and also its actual behavior (for instance try changing Adjusts Scroll View Insets or Extended Edges).

enter image description here

Upvotes: 2

Related Questions