2013-10-30 1 views
1

이 문제가 있습니다.탭 표시 줄 이미지가 표시되지 않습니다.

- (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"; 
} 
: RootViewController에서 나는 한 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]; 

: 나는 AppDelegate에에서 만든 TabBar의이

하지만 아무 것도 표시되지 않습니다. 이유가 무엇입니까? 이상한 점은 navigationController 없이도 똑같은 일을하면 이미지가 올바르게 표시된다는 것입니다.

+0

은 AppDelegate에에 tabbarItem에 대한 이미지를 추가 코드 .. – TamilKing

+0

풋 브레이크 포인트를 사용하고 확인? 나는 잘 작동하는지 점검했다. –

+0

예 확인한 바, 탭 제목과 이미지가 지정되었지만 표시되지 않았습니다. – Anna565

답변

0

그냥 아래

[self.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"tabRoot.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"tabRoot.png"]]; 
+0

불행히도 작동하지 않습니다. – Anna565