1
votes

iOS 8.2 - iPad or iPhone.

I'm creating a basic Master-Detail app in Xcode to test the UISplitViewController. I'm selecting my detail-navigation controller from the storyboard and selecting that I want to show the toolbar. This appears in the storyboard.

I'm also selecting Hide Bars on Tap in the properties window (as shown).

enter image description here

However, when I run the app, only my Navigation bar appears/disappears. The toolbar remains static at the bottom of the screen. Even if I set this in code, my toolbar is still static.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.
    let splitViewController = self.window!.rootViewController as UISplitViewController
    let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as UINavigationController
    navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem()
    splitViewController.delegate = self

    navigationController.hidesBarsOnTap = true;
    return true
}

Yet the documentation suggests both bars should be hidden/shown on tap.

Discussion When the value of this property is YES, the navigation controller toggles the hiding and showing of its navigation bar and toolbar in response to an otherwise unhandled tap in the content area. The default value of this property is NO.

Does this property actually work on the toolbar? If so, is there anything else I should be doing? Thanks

1
have you tried hiding it with setToobarHidden:animated: already?Louis Tur

1 Answers

5
votes

The toolbar will only hide if you have put a bar button item inside.