Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6045869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:10:22+00:00 2026-05-23T07:10:22+00:00

My UITabBar is not completely showing after I present a UITabBarController from a UIViewController.

  • 0

My UITabBar is not completely showing after I present a UITabBarController from a UIViewController. Please can you tell me what I am doing wrong?

My code is:

//some method

LoggedInViewController *lvc = [[[LoggedInViewController alloc] initWithAccount:account] autorelease];
[self presentModalViewController:lvc animated:YES];

- (void)viewDidLoad

{
    self.tabController = [[UITabBarController alloc] init];
    LoggedInFeedNavigationController *navController = [[LoggedInFeedNavigationController alloc] initWithAccount:self.account];
    [self.tabController setViewControllers:[NSArray arrayWithObject:navController]];
    [self.view addSubview:self.tabController.view];
    [super viewDidLoad];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:10:22+00:00Added an answer on May 23, 2026 at 7:10 am

    It’s not a good practice to do:

    [viewController1.view addSubview:viewController2.view];
    

    The point of the MVC design is lost. The view controller should get your data (from the model) and put it in the view. If you have more than one view just arrange the functionality of the views to accept the corresponding data.

    So if you need a tab bar controller you should do the following:

    // assuming you are in the same initial controller
    UITabBarController* pTabBarControllerL = [[UITabBarController alloc] init];
    MyFirstController* pFirstControllerL = [[MyFirstController alloc] init];
    [pTabBarControllerL setViewControllers:[NSArray arrayWithObject:pFirstControllerL]];
    // perhaps set more tab bar controller properties - button images and so on
    [self presentModalViewController:pTabBarControllerL animated:YES];
    // release the memory you do not need
    
    -(void)viewDidLoad {
        // do your work in pFirstControllerL
    }
    

    PS: You should not subclass UINavigationController and UITabBarController.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a root UIViewController subclass that has a UITabBar, (I'm not using UITabBarController)
In my iphone application I put a UITabBar (not using UITabBarController) in the bottom
I want to make UITabBar, (not UITabBarController) in my viewDidLoad of ViewController.
I have a UITabBar + UINavigationController application which often needs data from the internet.
I'm using a UITabBar without a controller. I want to remove tabs from the
Im working on an iPhone app, not using IB, and programmatically created a UITabbar
I am trying to nest a UITabBar inside another one, like so: UITabBarController *tabController
I am using a UITabBar control from library in one of my view (note
I have this code - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item What I am looking for
I have a UIView that I want to slide from behind a UITabBar to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.