UITabBar не показывает название предметов - PullRequest
0 голосов
/ 19 марта 2012

Я использую UITabBar, но он не показывает название элементов. Что я делаю не так?

Вот пример, который я использую:

    UITabBar *menu = [[UITabBar alloc] initWithFrame:CGRectMake(0, 480 - 100, 320, 100)];

    NSMutableArray *items = [[NSMutableArray alloc] init];
    UITabBarItem *item = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemRecents tag:0];
    [items addObject:item];
    [item release];
    item = [[UITabBarItem alloc] initWithTitle:@"item 1" image:[UIImage imageNamed:@"test1.png"] tag:1];
    [items addObject:item]; 
    [item release];
    item = [[UITabBarItem alloc] initWithTitle:@"item 2" image:[UIImage imageNamed:@"test2.png"] tag:2];
    [items addObject:item];
    [item release];
    item = [[UITabBarItem alloc] initWithTitle:@"item 3" image:[UIImage imageNamed:@"test3.png"] tag:2];
    [items addObject:item];
    [item release];
    item = [[UITabBarItem alloc] initWithTitle:@"item 4" image:[UIImage imageNamed:@"test4.png"] tag:2];
    [items addObject:item];
    [item release];
    item = [[UITabBarItem alloc] initWithTitle:@"item 5" image:[UIImage imageNamed:@"test5.png"] tag:2];
    [items addObject:item];
    [item release];
    item = [[UITabBarItem alloc] initWithTitle:@"item 6" image:[UIImage imageNamed:@"test6.png"] tag:3];
    [items addObject:item];
    [item release];

    [menu setItems:items animated:false];
    [[self view] addSubview:menu];

    [menu release];
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...