2012-06-02 30 views

回答

2

看看的UITabBarItem的文檔的「管理成品和選擇的圖像」任務的部分。

+0

這並沒有解決圖像着色的問題。 –

+0

'selectedImageTintColor'文檔清楚地說:'如果你還想自定義未選擇的圖像外觀,你必須發送setFinishedSelectedImage:withFinishedUnselectedImage:單個標籤欄項目。' – Mat

+1

完美!這也有助於我刪除出現在圖標上的令人討厭的默認漸變的獎勵! – John

1

而對於一個快速切入「N粘貼:

NSArray *tabBarImages = [[NSArray alloc] initWithObjects:@"tab_a.png", 
         @"tab_b.png", 
         @"tab_c.png", 
         @"tab_d.png", 
         @"tab_e.png", 
         nil]; 


for (uint i=0;i<[_tabBarController.tabBar.items count];i++) 
{ 
    UITabBarItem *uitbi = [_tabBarController.tabBar.items objectAtIndex:i]; 

    NSString *imageRef = [tabBarImages objectAtIndex:i]; 
    [uitbi setFinishedSelectedImage:[UIImage imageNamed:imageRef] withFinishedUnselectedImage:[UIImage imageNamed:imageRef]]; 

}