Вопрос

I have this code:

 MeuPrimeiroViewController *primeiro = [[MeuPrimeiroViewController alloc] init];
    MeuSegundoViewController *segundo = [[MeuSegundoViewController alloc]init];

    UITabBarController *tabbar = [[UITabBarController alloc] init];

    tabbar.viewControllers = [NSArray arrayWithObjects:primeiro,segundo, nil];

    primeiro.tabBarItem.title = @"Primeiro";
    primeiro.tabBarItem.image = [UIImage imageNamed:@"1.jpg"];
    segundo.tabBarItem.title = @"Segundo";
    segundo.tabBarItem.image = [UIImage imageNamed:@"3.jpg"];


    self.window.rootViewController = tabbar;

I don't know why, the images don't show?

Это было полезно?

Решение

You need to use the tabBarItem initWithTitle:image:selectedImage method instead. See the method definition here.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top