在选项卡栏和导航栏内弹出视图时遇到问题
我有一个 UITabBarController,它是 UINavigationBarController 中的第二项。 UITabBarController 中有几个视图,其中一个是名为 AccountViewController 的 UIViewController 子类。明白了吗?
Login View Controller -> UIViewController + UITabBarController - > Account View Tab -> Button
我想使用按钮 - 注销 - 弹回登录视图。我该怎么做呢?
I have a UITabBarController, which is the second item in a UINavigationBarController. Within the UITabBarController are a couple of views, one of which is a UIViewController subclass called AccountViewController. Got that?
Login View Controller -> UIViewController + UITabBarController - > Account View Tab -> Button
I want to use a button - Logout - to pop back to the Login view. How would I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您正在其中一个
UIViewControllers
中创建UITabBarController
,它们是UINavigationController
中视图控制器字符串的一部分,您在其中做了类似的操作对此:您可以从添加到
mytabs.viewControllers
数组的UIViewControllers
之一中调用它,如下所示:您还可以指定是否希望它转到一个具体的UINavigationController 堆栈中的 viewController 索引(以防万一您的登录 viewController 不是下一个或根视图控制器)。
Assuming you are creating the
UITabBarController
within one of theUIViewControllers
which are part of the string of view controllers within theUINavigationController
where you have done something similar to this:You can call this from within one of the
UIViewControllers
that are added to yourmytabs.viewControllers
array like so:You can also specify if you want it to go to a specific viewController index in the UINavigationController stack ( just in case your Login viewController isn't the next one down or the root view controller ).