login page and navigation bar

♀尐吖头ヾ 提交于 2020-02-02 13:18:43

问题


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?


回答1:


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];

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];

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



来源:https://stackoverflow.com/questions/4250445/login-page-and-navigation-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!