Show toolbar above TabBar

In my application, I would like to replace the TabBar ToolBar under certain conditions, similar to what happens in the Photos application, when the user places it in the selection mode (toolbar with shared copies, etc.) appears above the tab bar). How can I achieve this, please?

+4
source share
2 answers

This can be done by creating a new toolbar, assigning it an appropriate frame and adding it to self.tabBarController.view

+5
source

I assume your root view controller is a UITabBarController. Sometimes using canned "root" UIViewControllers is more of a hindrance than help, especially if you want your custom look not to fit into the paradigm of what canned controllers offer. There is no reason why you should use them - you can write your own and make your own transition between the views of your sub-UIViewController on the screen. You can use UITabBar without UITabBarController in your own subclass of UIViewController, then you will not struggle with the behavior of UITabBarController. Writing your own root ViewController can be very instructive - you'll learn about all the things that a root ViewController needs to do to control sub-controllers.

+1
source

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


All Articles