Suppress moreNavigationController in custom UITabBarController

后端 未结 2 2059
遥遥无期
遥遥无期 2021-02-09 19:17

I have implemented a custom UITabBar solution for a project. Essentially, if there are more than 5 items, I use a scrollView that will allow the user to scroll through the addit

2条回答
  •  一向
    一向 (楼主)
    2021-02-09 19:45

    You may also override the moreNavigationController var of UITabBarController and return your own custom NavigaitonContorller like so:

    override var moreNavigationController: UINavigationController { return MyCustomNavController() }

    worked in my case where I needed a NavigaitonController that allowed hiding the NavigationBar when scrolling.

    As for hiding the Back Button of the MoreNavigationController you can set the leftBarButtonItem of each NavigationItem to anything (even an empty UIBarButtonItem) and the back butotn of the more NavigaitonController will disappear.

提交回复
热议问题