In meinem Delegate ich versuche, meine TabBarController
auszuwählen, so dass ich es mit einem anderen Hintergrund stylen kann. Aber das Problem ist, dass mein TabBarController
nicht auf dem RootView befindet ..Holen Sie Tabbarcontroller aus einer anderen Sicht auf meinem Storyboard
Mein aktueller Code:
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];
UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1];
In meinem Interface Builder ich habe meine TabBarController
Setup mit einem Segue Namen: Mainview (Dies ist, wo die TabBarController
befindet sich).
Wie kann ich meine TabBarController
auswählen?
in dem Teil erhalten mögen von der code willst du deinen tabBarController auswählen? In einem UIViewController, der in der TabBar ist, APPDelegate, ...? –
Ja in meiner ersten Zeile Ich möchte 'self.window.rootViewController;' mit meinem TabBarController ersetzen, so dass ich es manipulieren kann – Alosyius
Ja, aber ich möchte wissen, in welcher ViewController/Methode Sie das Stück Code aufrufen, den Sie gerade gepostet –