1
我有这个问题。我在的appDelegate创建的TabBar:不显示标签栏图像
RootViewController *controller = [[RootViewController alloc] initWithNibName:@"RootView" bundle:nil];
UINavigationController *rootNavigationController = [[UINavigationController alloc] initWithRootViewController:controller];
[其他控制器初始化...]
self.tabController = [[UITabBarController alloc] init];
self.tabController.viewControllers = [NSArray arrayWithObjects:rootNavigationController,secondController,thirdController, nil];
现在,当在RootViewController的我尝试指定图像的TabBar:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.tabBarItem.image = [UIImage imageNamed:@"tabRoot.png"];
self.tabBarItem.title = @"Root";
}
但是没有显示,为什么?奇怪的是,如果我做同样的事情,但没有navigationController,图像正确显示。
为tabbarItem添加图片中的appDelegate .. – TamilKing
放破发点,并检查?我已检查其工作正常。 –
是的,我检查过,标签栏标题和图像被分配,但不显示 – Anna565