Tab Bar Disappear When Back to Preliminary Sight Controller

Overview

A navigation controller is a container view controller that manages one or more child view controllers in a navigation interface. In this type of interface, just one kid view controller shows up each time. Picking a thing in the view controller pushes a brand-new sight controller onscreen utilizing an animation, therefore concealing the previous sight controller. Tapping the back button in the navigation bar on top of the interface removes the top sight controller, thereby revealing the view controller underneath.

We can utilize the view controllers that the UIKit framework offers by themselves or combined with other view controllers to produce a lot more advanced user interfaces. When incorporating sight controllers, nonetheless, the order of containment is important; only particular arrangements stand. The order of containment, from child to parent, is as follows.

1. Material view controllers, as well as container sight controllers that have flexible bounds (such as the web page view controller).

2. Navigation view controller.

3. Tab bar controller.

4. Split view controller.

Tab Bar Disappearing? How to Solve It?

The most usual factor for this issue is that you press UITabBarController in the navigating stack. It ought to be used as a root view controller of the application. Maybe you should make use of a custom-made container controller rather than a tab bar controller.

If you're making use of UITabBarController to display a tab strip at the end of your interface, the default action for iPhone is to show the tabs at all times... even if the user has navigated deep into a UINavigationController in one of the tabs.

If you don't desire that behavior, you must set hidesBottomBarWhenPushed to real where applicable. This will hide the tab bar in addition to any kind of toolbars you had shown, but only when a view controller is pressed onto the navigation stack. This enables you to show the tab bar initially, after that hide it when you require even more room.

If you're making use of segues, the best location to set this property is inside the prepare( for:-RRB- approach, where you set up any other residential properties in your destination sight controller.

override func prepare( for segue: UIStoryboardSegue, sender: Any type of?)
self.hidesBottomBarWhenPushed = real.

If you aren't utilizing segues, you will normally need to bypass the initializer for your sight controller and set hidesBottomBarWhenPushed to true there, similar to this:

override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
    super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
    hidesBottomBarWhenPushed = true
}


Leave a reply



Submit