UITabbarController + UINavigationController, detailed view with UIToolbar instead of tab bar

In my main window IB file, I have a TabBarController and the first controller is a navigation controller. When I click on my detailed view (after clicking a cell in a table view), I want to click on my detailed view and display the toolbar instead of the tab bar. The problem is that when you try

 tabBar.hidden = visible;

in my detail view controller (viewDidLoad) the tab stops before the animation between the first view and the detail view is done.

What I want to achieve can be seen in my own application for photos when you click on one of the images from the gallery. There, the tab moves with the animation of the first view.

How do I achieve this?

Thanks in advance

+3
source share
1 answer

check the "hidesBottomBarWhenPushed" property on a subclass of your UIViewController page detail

either override this method

- (BOOL)hidesBottomBarWhenPushed
{
    return YES;
}

or I assume this will work the same way:

self.hidesBottomBarWhenPushed = YES;

To show the toolbar:

- (void)viewWillAppear:(BOOL)animated
{
    [self.navigationController setToolbarHidden:NO animated:YES];
}

and at the exit

- (void)viewWillDisappear:(BOOL)animated
{
    [self.navigationController setToolbarHidden:YES animated:YES];
}
+4
source

Source: https://habr.com/ru/post/1771446/


All Articles