Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
527 views
in Technique[技术] by (71.8m points)

iphone - show a login screen before Tab bar controller?

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

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

What you can do is the following.

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.

EDIT: For a code example look at code provided by Maulik


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...