浏览代码

fixed toggle tabs bug (#2369)

yogevbd 6 年前
父节点
当前提交
d0d291dade
没有帐户链接到提交者的电子邮件
共有 3 个文件被更改,包括 4 次插入1 次删除
  1. 2
    0
      ios/RCCTabBarController.h
  2. 1
    0
      ios/RCCTabBarController.m
  3. 1
    1
      ios/RCCViewController.m

+ 2
- 0
ios/RCCTabBarController.h 查看文件

@@ -6,4 +6,6 @@
6 6
 - (instancetype)initWithProps:(NSDictionary *)props children:(NSArray *)children globalProps:(NSDictionary*)globalProps bridge:(RCTBridge *)bridge;
7 7
 - (void)performAction:(NSString*)performAction actionParams:(NSDictionary*)actionParams bridge:(RCTBridge *)bridge completion:(void (^)(void))completion;
8 8
 
9
+@property (nonatomic) BOOL tabBarHidden;
10
+
9 11
 @end

+ 1
- 0
ios/RCCTabBarController.m 查看文件

@@ -350,6 +350,7 @@
350 350
   if ([performAction isEqualToString:@"setTabBarHidden"])
351 351
   {
352 352
     BOOL hidden = [actionParams[@"hidden"] boolValue];
353
+    self.tabBarHidden = hidden;
353 354
     
354 355
     CGRect nextFrame = self.tabBar.frame;
355 356
     nextFrame.origin.y = UIScreen.mainScreen.bounds.size.height - (hidden ? 0 : self.tabBar.frame.size.height);

+ 1
- 1
ios/RCCViewController.m 查看文件

@@ -719,7 +719,7 @@ const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
719 719
 - (BOOL)hidesBottomBarWhenPushed
720 720
 {
721 721
   if (!self._hidesBottomBarWhenPushed) return NO;
722
-  return (self.navigationController.topViewController == self);
722
+  return (self.navigationController.topViewController == self) && ![(RCCTabBarController*)self.tabBarController tabBarHidden];
723 723
 }
724 724
 
725 725
 - (BOOL)prefersStatusBarHidden