Browse Source

tabbar hide fix (#2084)

Roman Kozlov 7 years ago
parent
commit
4e1928d592
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      ios/RCCTabBarController.m

+ 5
- 1
ios/RCCTabBarController.m View File

344
   if ([performAction isEqualToString:@"setTabBarHidden"])
344
   if ([performAction isEqualToString:@"setTabBarHidden"])
345
   {
345
   {
346
     BOOL hidden = [actionParams[@"hidden"] boolValue];
346
     BOOL hidden = [actionParams[@"hidden"] boolValue];
347
+    
348
+    CGRect nextFrame = self.tabBar.frame;
349
+    nextFrame.origin.y = UIScreen.mainScreen.bounds.size.height - (hidden ? 0 : self.tabBar.frame.size.height);
350
+    
347
     [UIView animateWithDuration: ([actionParams[@"animated"] boolValue] ? 0.45 : 0)
351
     [UIView animateWithDuration: ([actionParams[@"animated"] boolValue] ? 0.45 : 0)
348
                           delay: 0
352
                           delay: 0
349
          usingSpringWithDamping: 0.75
353
          usingSpringWithDamping: 0.75
351
                         options: (hidden ? UIViewAnimationOptionCurveEaseIn : UIViewAnimationOptionCurveEaseOut)
355
                         options: (hidden ? UIViewAnimationOptionCurveEaseIn : UIViewAnimationOptionCurveEaseOut)
352
                      animations:^()
356
                      animations:^()
353
      {
357
      {
354
-       self.tabBar.transform = hidden ? CGAffineTransformMakeTranslation(0, self.tabBar.frame.size.height) : CGAffineTransformIdentity;
358
+         [self.tabBar setFrame:nextFrame];
355
      }
359
      }
356
                      completion:^(BOOL finished)
360
                      completion:^(BOOL finished)
357
      {
361
      {