UITabBarController 选项卡充当注销按钮,而不是显示相应的视图
我有一个基于 UITabBarController 的 iPhone 应用程序。我通过 Interface Builder 添加了一个名为“注销”的新选项卡。
但是我不需要它相应的视图。我希望“注销”选项卡在单击后立即重定向到“登录”视图(当然也会执行一些会话清除代码)。
到目前为止,我得到的最接近的是使用 viewWillAppear 从注销视图重定向。结果是相同的,但看起来不太好,因为它会进入空白屏幕几秒钟,然后重定向到登录屏幕。
任何帮助将不胜感激。
I have a UITabBarController based iphone application. I added a new tab called Log Out via the Interface Builder.
However I don't need its corresponding view. I want the Log Out tab to redirect to the Login view as soon as it is clicked (of course some session clearing code is executed as well).
The nearest I've got so far is to redirect from the Log Out View using the viewWillAppear. The result is the same but it doesnt look great because it goes into a blank screen for a couple of seconds and then it redirect to the login screen.
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 UITabbarDelegate 方法来完成此
操作使用以下委托方法检查注销按钮索引,如果找到则执行您的任务
You can use UITabbarDelegate methods to accomplish this
Use following delegate method to check for logout buttons index and if found then perform your tasks