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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:54:39+00:00 2026-06-02T20:54:39+00:00

When using UITabBarController in my app, I cannot get the first item in it’s

  • 0

When using UITabBarController in my app, I cannot get the first item in it’s TabBar to be selected (i.e. blue color). It just stays black and gray.

Is there another method to activate a certain item in the TabBar? I’m using:

self.tabController.selectedIndex = 0;

(For matter of interested, this is all instantiated in the AppDelegate as the delegate is handling a welcome view) which is, once dismissed removed from screen and the UITabController.view is taking over.

Update:

In the Main App Delegate, I use this code to show the tabController and set the index:

#pragma mark - Click handlers

- (void) startApp:(id)sender {
    [UIView transitionFromView:self.welcomeView
                        toView:self.tabController.view
                      duration:0 
                       options:UIViewAnimationOptionTransitionFlipFromRight
                    completion:nil];

    self.tabController.selectedIndex = 0;
}

self.tabController is not null, else I would not be able to see the view on the screen.

  • 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-02T20:54:40+00:00Added an answer on June 2, 2026 at 8:54 pm

    This was happening to me as well. I finally realized it came down to the way I was constructing the UITabBarItems for my tab views. Being unable to find any examples of the proper way to provide the images for the tabs, I had settled on overridding tabBarItem in each of my views to return a UITabBarItem I had constructed myself. This appeared to load the icons properly but wouldn’t change the higlight when I changed the selectedIndex programmatically.

    Finally last night I found code like this in the init method of the child view controllers in an iOS book on Google Books:

    UIImage *anImage = [UIImage imageNamed:@"foo"];
    self.tabBarItem.image = anImage;
    

    Setting up the tab bar items this way fixed the problem with highlighting the correct button when switching tabs programmatically for me.

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

Sidebar

Related Questions

I created an app for iPad (not using StoryBoards), with a UITabBarController. I added
I'm having a problem using the UITabBarController and can't seem to get anywhere... maybe
I've any problems for app I'm developing... I'm using Core Data and I just
I'm using UITabBarController in my app. Originally I started the app from SDK 4.3
I have an tabbed App using UITabBarController . There are 2 tabs, linked to
I have built my app using Storyboards. I have a UITabBarController and a NavigationController
I'm creating an app using a UITabBarController as the main form of navigation, having
I am using a tab bar (UITabBarController) on my app and I wish to
I'm trying to get the following functionality in my iPhone app: When backgrounded, stays
I have an app using a UITabBarController, and I have another view that needs

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.