我已经按照本教程UITabBarController
成功创建并实现了一个自定义。它工作正常,直到我不得不隐藏它。UITabBar
我没有使用 Storyboards 或 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;
}
关于如何实现它的任何想法?提前致谢!