LondonGuy
LondonGuy

Reputation: 11098

UiTabBarController's tabs aren't showing at all but functional, what could be causing this issue?

As you can see in the image below the tab bar is visible but the tabs aren't. However I am still able to click where both of the tabs would be and flick between 2 views.

What could be wrong?

AppDelegate Code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    HypnosisViewController *hvc = [[HypnosisViewController alloc] init];

    TimeViewController *tvc = [[TimeViewController alloc] init];

    UITabBarController *tabBarController = [[UITabBarController alloc] init];
    NSArray *viewControllers = [NSArray arrayWithObjects:hvc, tvc, nil];
    [tabBarController setViewControllers:viewControllers];

    [[self window] setRootViewController:tabBarController];



    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

Regards

enter image description here

Upvotes: 0

Views: 48

Answers (1)

Florian
Florian

Reputation: 226

You haven't declared any titles or images for your TabBar items. Use something like this: initWithTabBarSystemItem:tag:

Upvotes: 1

Related Questions