UITabBar *frameTabBar = [[UITabBar alloc] initWithFrame:CGRectMake(0, 698, 1024, 70)];
UITabBarItem *frameTabBarItem1 = [[UITabBarItem alloc] initWithTitle:@"Fee" image:nil tag:0];
UITabBarItem *frameTabBarItem2 = [[UITabBarItem alloc] initWithTitle:@"Dev" image:nil tag:1];
NSArray *frameTabBarItemArray = [[NSArray alloc] initWithObjects:frameTabBarItem1,frameTabBarItem2,nil];
[frameTabBar setItems:frameTabBarItemArray];
But there isnt any Item displayed in my UITabBar.
What’s wrong with my code.
Thanks.
I’m sure that the items are there, you just can’t see them because you didn’t set an image and the labels are out of your visible frame.
698 + 70 = 768
768 is the height of an iPad in landscape orientation. But, if there is a statusbar, the usable frame is 20 pixel smaller. And the 20 pixel are exactly the height that would hide your tab labels.
So just subtract 20 pixel from the y position and you are good.