2012-06-04 5 views

Antwort

8

Alle Ihre Controller aus einer tabview sind über das Array des tabviewcontrollers zugänglich. Sie können sie direkt dort ändern. Wenn Sie etwas ändern möchten, bevor der Benutzer dieses spezifische Element sieht, legen Sie den Delegaten fest und implementieren Sie die Delegate-Methode. (Sie können einfach die vc innerhalb dieser Methode ändern und das Rück ja)

http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UITabBarControllerDelegate_Protocol/Reference/Reference.html

tabBarController:shouldSelectViewController: 

Asks the delegate whether the specified view controller should be made active. 
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController Parameters 

tabBarController 

    The tab bar controller containing viewController. viewController 

    The view controller belonging to the tab that was tapped by the user. 

Return Value 

YES if the view controller’s tab should be selected or NO if the current tab should remain active. Discussion 

The tab bar controller calls this method in response to the user tapping a tab bar item. You can use this method to dynamically decide whether a given tab should be made the active tab. Availability 

    Available in iOS 3.0 and later. 

Declared In UITabBarController.h 
+0

Brilliant Antwort. Danke – Slappy

+0

Dies wird nicht aufgerufen, wenn die Registerkarte programmatisch geändert wird. – malhal

Verwandte Themen