diff --git a/ios/RCCTabBarController.h b/ios/RCCTabBarController.h index e27c6a44cbc..9274fec4b17 100755 --- a/ios/RCCTabBarController.h +++ b/ios/RCCTabBarController.h @@ -6,4 +6,6 @@ - (instancetype)initWithProps:(NSDictionary *)props children:(NSArray *)children globalProps:(NSDictionary*)globalProps bridge:(RCTBridge *)bridge; - (void)performAction:(NSString*)performAction actionParams:(NSDictionary*)actionParams bridge:(RCTBridge *)bridge completion:(void (^)(void))completion; +@property (nonatomic) BOOL tabBarHidden; + @end diff --git a/ios/RCCTabBarController.m b/ios/RCCTabBarController.m index 179c684c7ef..7f5568bc4fb 100755 --- a/ios/RCCTabBarController.m +++ b/ios/RCCTabBarController.m @@ -350,6 +350,7 @@ - (void)performAction:(NSString*)performAction actionParams:(NSDictionary*)actio if ([performAction isEqualToString:@"setTabBarHidden"]) { BOOL hidden = [actionParams[@"hidden"] boolValue]; + self.tabBarHidden = hidden; CGRect nextFrame = self.tabBar.frame; nextFrame.origin.y = UIScreen.mainScreen.bounds.size.height - (hidden ? 0 : self.tabBar.frame.size.height); diff --git a/ios/RCCViewController.m b/ios/RCCViewController.m index 964e8a9d0f6..dbedcd4d4c1 100755 --- a/ios/RCCViewController.m +++ b/ios/RCCViewController.m @@ -719,7 +719,7 @@ - (void)setStyleOnInit - (BOOL)hidesBottomBarWhenPushed { if (!self._hidesBottomBarWhenPushed) return NO; - return (self.navigationController.topViewController == self); + return (self.navigationController.topViewController == self) && ![(RCCTabBarController*)self.tabBarController tabBarHidden]; } - (BOOL)prefersStatusBarHidden