pa12
pa12

Reputation: 1503

uitabbarController view not resizing

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. enter image description here enter image description here

Upvotes: 0

Views: 539

Answers (2)

tabbarCon.view.autoresizesSubviews = YES;
tabbarCon.view.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);

or

set your parentview controller view like this.

Upvotes: 1

Legolas
Legolas

Reputation: 12335

  1. Use a TabBar Controller as your rootViewController, and set this in your APP Delegate.

    [_window addSubview:rootViewController.view];
    
  2. 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];
    
  3. 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];
    
  4. 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

Related Questions