首页 > 解决方案 > 在选项卡之间移动时固定导航栏

问题描述

我在 TabBar 的所有视图中使用相同的 NavBar,现在我有一个 Initial TabBarController,其中包含五个 NavigationController,每个都有其 ViewController。The thing is that when selecting any section in the TabBar the hole screen, including the NavBar, moves to the selected section.

我需要修复导航栏和标签栏,并且只有在点击进入某个屏幕时才能移动中间的内容。

希望问题描述清楚。任何想法我可以做些什么来复制这种行为?谢谢!

标签: iosobjective-cswiftxcodeinterface

解决方案


发生这种情况的原因是因为每个选项卡/视图都有自己的 NavigationController。相反,您需要与所有视图共享一个 NavigationController,这样 NavBar 就不会每次都是新的


推荐阅读