在Tab栏控制器之前显示登录屏幕? [英] show a login screen before Tab bar controller?

查看:75
本文介绍了在Tab栏控制器之前显示登录屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个应该首先显示登录屏幕的iphone应用程序,之后它应该显示带有5个标签的标签栏控制器。
我最初能够启动登录屏幕,但在此之后无法显示标签栏控制器,请帮我解决源代码问题。
这是我的代码:
这是一个基于视图的应用程序

i am designing an iphone application which should be display login screen initially, after that it should display tab bar controller with 5 tabs. Am able to launch login screen initially, but after that am unble to show tab bar controller, kindly help me out with the source code guys. here is my code: this is a view based application

application.M

application.M

 -(void)applicationDidFinishLaunching:(UIApplication *)application {    

    // Override point for customization after app launch 
       [window addSubview:viewController.view]; 
    [window addSubview:tabBarController. view];   
    [window makeKeyAndVisible];
    LoginView *loginView=[[LoginView alloc]initWithNibName:@"LoginView" bundle:nil];
    [window addSubview:loginView.view];
}  

通过执行此操作,标签栏控制器显示在登录屏幕的底部initial.And也无法在标签栏项目之间切换。

by doing this the tab bar controller is displaying at the bottom of the login screen initially.And also am unable to switch between the tab bar items.

推荐答案

您可以做的是以下内容。

What you can do is the following.

启动Tabbar作为主屏幕,然后在加载或显示视图之前显示登录屏幕并在成功登录后关闭登录屏幕。

Launch the Tabbar as the main screen and then before the view is loaded or displayed show the logon screen and dismiss the logon screen after successful log on.

编辑:有关代码示例,请查看Maulik提供的代码

For a code example look at code provided by Maulik

这篇关于在Tab栏控制器之前显示登录屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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