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

  • Home
  • SEARCH
  • 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 389587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:52:53+00:00 2026-05-12T15:52:53+00:00

I am using a UITabBar control from library in one of my view (note

  • 0

I am using a UITabBar control from library in one of my view (note that I am not using UITabBarController but the UITabBar control).

Now, I am adding two tabBar items to this tabBar.

I have created controller class for this view (.m and .h) files and used delegates in the .h file.

In the .m file I have used the following function:

  • (void)tabBar:(UITabBar *)TabBarControl didSelectItem:(UITabBarItem *)FirstView

I have assigned tag = 0 and tag = 1 to respective tabBar items.

What I want to do is that, on click of first tabBar item I want to show a view and click of another tabBar item, I want to show another view.

So, in the above function I am checking that if the tag of clicked tabBar item is 0 than I will show one view else I will show another view.

I am showing the view as following:

Team1Scoreboard *tempTeam1Scoreboard = [Team1Scoreboard alloc];
tempTeam1Scoreboard = [tempTeam1Scoreboard initWithNibName:@”UserTeamScoreboard” bundle:[NSBundle mainBundle]];

    self.cntrlTeam1Scoreboard = tempTeam1Scoreboard;

    [tempTeam1Scoreboard release];

    UIView *theWindow = [self.view superview];
    [self.view removeFromSuperview];
    [theWindow addSubview:self.cntrlTeam1Scoreboard.view];

Now the problem is that, when I click on any of the tabBar item, it will load the correct view but the tabBar itself will be disappeared as I am adding the view to window itself.

Please help me so that I can load correct view and also my tabBar itself is visible.

  • 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-12T15:52:54+00:00Added an answer on May 12, 2026 at 3:52 pm

    The TabBar is disappearing because it’s a child of the view which you are then adding a new child to and the new child is sized the same as the parent. Did that make sense? Ok, look at it this way:

    You have ViewA and ViewA has a couple of labels and a TabBar. ViewA is managed by ViewControllerA. In ViewControllerA you are creating an instance of ViewB and calling ViewControllerA.view addSubView:instanceOfViewB, right? Before doing that, you will want to resize ViewB.

    Try something like this:

    ViewControllerB *viewControllerB = [[ViewControllerB alloc]initWithNibName:@"ViewB" bundle:nil];
    CGRect frame = CGRectMake(self.view.frame.origin.x, 
                              self.view.frame.origin.y,
                              self.view.frame.size.width, 
                              self.view.frame.size.height - 40);
    viewControllerB.view.frame = frame;
    [self.view addSubview:viewB.viewControllerB];
    

    Basically it should be close to what you are doing, but I’m setting the size to be 40 px less (whatever you need to remove the tab bar).

    • 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)
I try to place UITabbar on iPhone window using CGRectMake. But I found that
In my iphone application I put a UITabBar (not using UITabBarController) in the bottom
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I'm using a UITabBar without a controller. I want to remove tabs from the
I have UITabBar in view which have 5 tabs. I am using didSelectItem delegate
Im working on an iPhone app, not using IB, and programmatically created a UITabbar
I was using a UITabBar for my application but (for my own reasons) I
I have an UITabBar controller managing several controllers (using SDK 3.0). One of these
We wanted to use a UITabBar in our iPhone app, but with one exception:

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.