其實我有一個自定義TabBarController
和我需要設置badgeValue單獨tabbaritem
在最初那個自定義tabar加載與標籤欄項目的索引路徑。如何設置目標c中的標籤欄項目badgeValue?
[[self navigationController] tabBarItem].badgeValue = @"3";
我上面的代碼用於該UIViewcontroller
但只有當我點擊標籤欄項目表現出來的。
我也試過custom tabBarController
下面的代碼,但它沒有工作。
[[self.tabBarController.tabBar.items objectAtIndex:3] setBadgeValue:@"2"];
我需要在初始時顯示徽章值。
你是什麼意思初始?意思是當你的tabbarcontroller加載並顯示第一個標籤? – Lion
是的第一個標籤.... –