The UIViewControllers że są wypychane na stos nawigacyjnym można zrobić coś podobnego do następującego:
- (void)viewWillAppear:(BOOL)animated {
self.tabBarController.tabBar.hidden = NO; // Or YES as desired.
}
EDYCJA: Dodano dodatkowy kod belo w radzić sobie z ramą. Nie sądzę, żebym szczególnie polecał ten pomysł, ponieważ opiera się na wewnętrznej domyślnej strukturze widoku kontrolera UITabBarController.
Zdefiniuj następujące kategorię na UITabBarController:
@interface UITabBarController (Extras)
- (void)showTabBar:(BOOL)show;
@end
@implementation UITabBarController (Extras)
- (void)showTabBar:(BOOL)show {
UITabBar* tabBar = self.tabBar;
if (show != tabBar.hidden)
return;
// This relies on the fact that the content view is the first subview
// in a UITabBarController's normal view, and so is fragile in the face
// of updates to UIKit.
UIView* subview = [self.view.subviews objectAtIndex:0];
CGRect frame = subview.frame;
if (show) {
frame.size.height -= tabBar.frame.size.height;
} else {
frame.size.height += tabBar.frame.size.height;
}
subview.frame = frame;
tabBar.hidden = !show;
}
@end
Następnie, zamiast używania zmianę tabBar.hidden pierwotnie sugerowany, wykonaj następujące czynności:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.tabBarController showTabBar:NO];
}
Oczywiście upewniając się, że realizacja ma włączyła definicję kategorii, aby znany był "showTabBar".
dziękuję bardzo ... jest bardzo pomocna dla mnie ... to prawie miesiąc poszukiwania ... – Hiren