Reputation: 1503
I am having a navcontroller then in the next I am loading a tabbarControllor. I am using addsubview to add the tabbarcontrollor. Some part of my tabbar is hidden could any one please tell me whats wrong with this.
Upvotes: 0
Views: 539
Reputation: 25692
tabbarCon.view.autoresizesSubviews = YES;
tabbarCon.view.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
or
set your parentview controller view like this.
Upvotes: 1
Reputation: 12335
Use a TabBar Controller as your rootViewController, and set this in your APP Delegate.
[_window addSubview:rootViewController.view];
When your APP gets loaded, the tab bar controller comes up first, and by default - The First Tab! You should go to the view controller of your first tab, and in the viewDidLoad
of that file, use a ModalViewController
to use as a LoginViewController
.
LoginViewController *lvc = [[LoginViewController alloc]initWithNibName:@"LoginViewController" bundle:[NSBundle mainBundle]];
[self presentModalViewController:lvc animated:NO];
[lvc release];
If you get to this stage, the Login View Controller will pop up right after you launch the app. If login is successful, you can dismiss it
[self dismissModalViewControllerAnimated:YES];
If you dismiss it, it will show you the rootController, which is the TabBarController, and this is the approach used by most programmers for login and stuff.
Upvotes: 1