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 9042943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:37:29+00:00 2026-06-16T10:37:29+00:00

I have two tab bars in order to have effect like the one shown

  • 0

I have two tab bars in order to have effect like the one shown in Question of Sliding UITabBarItems in UITabBarController

Instead of an arrow, I am trying to use tab bar item at last index to show another tab bar, and hiding the current tab bar. I am adding second tab bar programmatically in viewDidLoad. Problem is that my second tab bar is not showing up on when last tab bar item is tapped. What I have done is:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.tabControler.view.frame = self.view.frame;
    self.tabControler.delegate = self;
    self.secondTabBarSelected = NO;

    self.secondTabBar = [[UITabBar alloc] initWithFrame:CGRectMake(0, 431, 320, 49)];
    self.secondTabBar.hidden = YES;
    self.secondTabBar.delegate = self;
    self.secondTabBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
    [self.tabControler.view addSubview:secondTabBar];

    [self.view addSubview:tabControler.view];
    NSLog(@"children of tabcon: %@",[tabControler.view subviews]); //Here second tab bar added with correct frame
}

-(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
    if (!self.secondTabBarSelected) {
        NSLog(@"first tab bar");
        if([[tabBarController viewControllers] indexOfObject:viewController] == 3)
        {
            self.firstTabBar.hidden = YES;
            self.secondTabBar.hidden = NO;

        }
    }
}
  • 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-06-16T10:37:32+00:00Added an answer on June 16, 2026 at 10:37 am

    I found that my tab bar was not visible because I was allocating it explicitly while it was present in nib file. Instead I just set the frame. My corrected code is:

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        // Do any additional setup after loading the view from its nib.
        self.tabControler.view.frame = self.view.frame;
        self.tabControler.delegate = self;
        self.secondTabBarSelected = NO;
    
        self.secondTabBar.frame = self.firstTabBar.frame;
        self.secondTabBar.hidden = YES;
        self.secondTabBar.delegate = self;
        NSLog(@"viewdidload frame: %@",secondTabBar.frame);
    
        self.secondTabBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
        [self.tabControler.view addSubview:self.secondTabBar];
        NSLog(@"viewdidload frame: %@",secondTabBar.frame);
    
    
        [self.view addSubview:tabControler.view];
    }
    
    -(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
    {
    
            NSLog(@"first tab bar - controller");
            if([[tabBarController viewControllers] indexOfObject:viewController] == 3)
            {
                self.firstTabBar.hidden = YES;
                self.secondTabBar.hidden = NO;
                self.secondTabBarSelected  = YES;
            }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one tabview which contain two different tab(subject and chapter) and i need
I have a tab contol with two tabs. Each one containing listviews. When the
I have two tab-delimited genome sequence files (SAM format), and I would like to
I have two files one is a tab delimited and one is a csv
I have two views. I want to place two different tab bars in each
I have two tabs in my home page and each tab has one jquery
I'm making an app with tab layout. Inside app I have two activities. One
I have two aspx buttons on two separate Jquery tab panels. I'd like to
I have two problems I am trying to solve, one is refreshing the tab
Currently I have two activitys inside one tab. In second activity I have custom

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.