如何处理视图控制器?
大家好,我正在开发一个应用程序。那里有一个带有 5 个按钮的主屏幕。单击每个按钮时,我想打开带有带有 5 个视图控制器的选项卡栏的屏幕。我的意思是,当您单击按钮时,选项卡栏将打开。标签栏视图上也有后退按钮。单击后退按钮时,我想弹回到主屏幕,反之亦然。 如何做到这一点,伙计们。任何教程、链接、示例代码将不胜感激。
非常感谢大家
Hi guys I am working on an application.Where there is a home screen with 5 buttons.On the click of every button i want to open the screen with tabbar with 5 view controllers.I mean when you click on the button the tabbar is opened.And there are back button on the tab bar view as well .On clicking the back button i want to pop back to the home screen and vice versa.
How to do that guys.Any tutorial ,links,sample code would be appreciated.
Thanks a lot to all
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
导航堆栈中的选项卡栏控制器很复杂。由于每个选项卡控制器本身也可以有导航控制器。
有一个 WindowManager 类。它应该同时拥有
- FirstViewController 和
-
TabbarController
所有组件和 UITabbarController 本身都应该在 WindowManager 类中实例化。
它的 init 可能有这样的代码,对于两个 tabbarcontroller 来说类似。
在 WindowManager 中,您可以有两种方法,例如,
您可以在第一个选项卡栏控制器左侧顶部有一个“后退”按钮,以调用
Tabbar controller in a navigation stack is complicated. Since each tab controller can have also navigation controller itself.
Have a
WindowManager
class. It should own both-
FirstViewController
and-
TabbarController
All components and the UITabbarControllers themselves should be instantiated in the WindowManager class.
Its
init
may have code like this, make similar for two tabbarcontrollers.In the
WindowManager
, you can have two methods like,You can have a "back" button on top of your first tabbar controller left side, to call the