このチュートリアルに従って、カスタム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;
}
それに到達する方法についてのアイデアはありますか?前もって感謝します!