iOS8似乎有些變化,現在我的標籤欄圖標都沒有正確顯示。大多數時候,他們不顯示,直到標籤被激活:iOS8如何設置TabBarItem圖像
但有時他們根本就不出現了,給我的只是一個藍色的大盒子(像每當我解僱一個觀點,即覆蓋了整個窗口):
這就是我所做的預iOS8上:
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];
[tabBarItem1 setFinishedSelectedImage:[UIImage imageNamed:@"paintbrush-white.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"paintbrush-black.png"]];
tabBarItem1.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0);
tabBarItem1.title = @"";
我一直無法找到任何表明它已被棄用的內容。還設置圖像和selectedImage屬性不起作用。 – 2014-09-27 00:49:10