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

The Archive Base Latest Questions

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

I have UITabBarController having 5 tabbar buttons. On some activity I want to unhighlight

  • 0

I have UITabBarController having 5 tabbar buttons. On some activity I want to unhighlight all the tab bat items.

Can anyone help please?

Thank you,

Ankita

  • 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-21T07:21:23+00:00Added an answer on May 21, 2026 at 7:21 am

    First of all, I’d like to say that unselecting all tabbaritems is a bad user experience. Chances are high that it won’t be accepted into the appstore.

    After I said that, I found the answere here. You can accept this answer (if it works!!!) but props should be given to that user. He used a trick in Key Value Observing, and used the following code:

    - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {     
        // Create the view controller which will be displayed after application startup     
        mHomeViewController = [[HomeViewController alloc] initWithNibName:nil bundle:nil];      
        [tabBarController.view addSubview:mHomeViewController.view];     
        tabBarController.delegate = self;     
        [tabBarController addObserver:self forKeyPath:@"selectedViewController" options:NSKeyValueObservingOptionNew context:NULL];      
        // further initialization ... 
    }  
    
    // This method detects if user taps on one of the tabs and removes our "Home" view controller from the screen. 
    - (BOOL) tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {     
        if (!mAllowSelectTab)     
        {         
            [mHomeViewController.view removeFromSuperview];         
            mAllowSelectTab = YES;     
        }      
        return YES; 
    }  
    
    // Here we detect if UITabBarController wants to select one of the tabs and set back to unselected. 
    - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {     
       if (!mAllowSelectTab)     
        {         
            if (object == tabBarController && [keyPath isEqualToString:@"selectedViewController"])         
            {             
                NSNumber *changeKind = [change objectForKey:NSKeyValueChangeKindKey];              
                if ([changeKind intValue] == NSKeyValueChangeSetting)             
                {                 
                    NSObject *newValue = [change objectForKey:NSKeyValueChangeNewKey];                  
                    if ([newValue class] != [NSNull class])                 
                    {                     
                        tabBarController.selectedViewController = nil;                 
                    }             
                }         
            }     
        } 
    }
    

    He added the following note:

    the first view controller from tabbar
    still will be loaded (although for a
    very short time), so its viewDidLoad
    and viewWillAppear will be called
    after startup. You may want to add
    some logic to prevent some
    initializations you probably may do in
    these functions until “real” display
    of that controller as a result of user
    tap (using for example global
    variables or NSNotificationCenter).

    EDIT: this is for adapting the Apple-UITabbar. You can also create a custom UITabbar.

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

Sidebar

Related Questions

Currently I have a UITabBarController with 4 items on it that all have associated
i have some difficulties changing tab bar controllers. Basically I have UITabBarController with 3
I have an UITabbarcontroller with 4 tabbar items.Each tabbar items have UINavigationController.Actually Tabbar loads
I'm having some problems resizing a UITabBarController as I only want it to take
I have a UITabBarController as my MainWindow.xib . I have 3 tab bar items
I have UITabBarController with 6 tabs. Now, the last 2 screens(tabbar items) are added
I have a UITabBarController with two UIViewControllers f.e All Messages, Favourite Messages. For some
I have a UITabBarController, and all the VCs in the tabs use the same
I have a UINavigationController inside a UITabBarController. When a user presses the first tab,
I have a custom UIViewController in a UITabbarController and want to respond to rotation

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.