我有一個iPhone應用程序,其中我使用tabbar.when自定義圖像選擇tabbar我必須顯示一個圖像和取消選擇顯示另一個。我已經成功實現了通過使用appdelegate中的波紋管代碼。 `如何更改tabbar中的圖像而不去該視圖控制器?
UIImage *selectedImage0 = [UIImage imageNamed:@"pinboard_hvr2.png"];
UIImage *unselectedImage0 = [UIImage imageNamed:@"pinboard2.png"];
UIImage *selectedImage2 = [UIImage imageNamed:@"scan_hvr2.png"];
UIImage *unselectedImage2 = [UIImage imageNamed:@"scan2.png"];
UIImage *selectedImage3 = [UIImage imageNamed:@"places_hvr2.png"];
UIImage *unselectedImage3 = [UIImage imageNamed:@"places2.png"];
UITabBar *tabBar = self.tabBarController.tabBar;
tabBar.TintColor = [UIColor clearColor];
UITabBarItem *item0 = [tabBar.items objectAtIndex:0];
UITabBarItem *item1 = [tabBar.items objectAtIndex:1];
UITabBarItem *item2 = [tabBar.items objectAtIndex:2];
[item0 setFinishedSelectedImage:selectedImage0 withFinishedUnselectedImage:unselectedImage0];
[item1 setFinishedSelectedImage:selectedImage2 withFinishedUnselectedImage:unselectedImage2];
[item2 setFinishedSelectedImage:selectedImage3 withFinishedUnselectedImage:unselectedImage3];
`但現在我的問題是我在那個按鈕,我需要我的每一個的TabBar圖標secondindex.when點擊查看教程根據在tutorial.but解釋改變我不需要在這裏。我想留在教程視圖本身,但需要更改圖標。任何人都可以幫助我實現這一目標嗎?