我已經成功創建並實現了自定義UITabBarController
,自定義UITabBar
後面this tutorial。它工作正常,直到我必須隱藏它。隱藏自定義UITabBar
我沒有使用故事板或IB,我必須獲得對我現有的UITabBarController
的引用,屏幕上將隱藏自定義的UIView
。我試圖做這種方式,但它只是創造UITabBarController
的新實例,而不是指向我原來的例子中,我在屏幕上看到:
SGTabBarController *tabBarController = [[SGTabBarController alloc] init];
[tabBarController hideCustomTabBar];
SGTabBarController.h
@interface SGTabBarController : UITabBarController
@property (nonatomic) int tabBarHeight;
-(void)hideCustomTabBar;
-(void)showCustomTabBar;
@end
SGTabBarController.m
-(void)hideCustomTabBar{
customTabBarView.hidden = YES;
NSLog(@"HIDDEN!!!");
}
-(void)showCustomTabBar{
customTabBarView.hidden = NO;
}
任何關於如何GE的想法對它?提前致謝!
您是否將tabBarController設置爲AppDelegate中的rootViewController?我以編程方式做到這一點,並能夠隨時訪問tabBarController。 – TheJer 2013-03-07 17:40:08
@TheJer讓它成爲答案,我會接受它!真棒! – 2013-03-07 18:05:59