登录页面和导航栏 [英] login page and navigation bar

查看:124
本文介绍了登录页面和导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首次启动应用时,我希望它显示一个登录按钮。成功登录后,我希望应用显示标签栏视图..这是否意味着我需要将我的应用委托设置为指向UITabBarController?我怎么能这样做?

When first launching the apps, I want it to show a button to log in. After successfully logged in, I want the app to show a tab bar view.. So does this mean that I need to set my app delegate to point to the UITabBarController? How can I do this?

推荐答案

我在应用委托中加载了我的UITabBarController,所以在添加登录界面之前最后一点applicationDidFinishLaunchingWithOptions看起来像这样:

I load my UITabBarController in the app delegate, so before adding the login screen the last bit of the applicationDidFinishLaunchingWithOptions looks like this:

[window addSubview:tabcontroller.view];
[window makeKeyAndVisible];

要添加一个覆盖标签栏的视图,只需将其插入tabbarcontroller之后和makeKeyAndVisible之前,如这个:

To add a view that covers the tabbar you simply insert it after the tabbarcontroller and before the makeKeyAndVisible, like this:

[window addSubview:tabcontroller.view];
[window addSubview:loginViewController.view];
[window makeKeyAndVisible];

loginViewController视图将显示覆盖所有内容。一旦解雇它,标签栏将可见并可用。

The "loginViewController" view will appear covering everything. Once you dismiss it the tab bar will be visible and usable.

这篇关于登录页面和导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆