react-native-navigation的迁移库

RNNTabBarController.m 660B

123456789101112131415161718192021222324
  1. #import "RNNTabBarController.h"
  2. #define kTabBarHiddenDuration 0.3
  3. @implementation RNNTabBarController
  4. - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
  5. return self.selectedViewController.supportedInterfaceOrientations;
  6. }
  7. - (void)setTabBarHidden:(BOOL)hidden animated:(BOOL)animated {
  8. CGRect frame = self.tabBar.frame;
  9. CGFloat height = frame.size.height;
  10. CGFloat offsetY = (hidden ? self.view.frame.size.height : self.view.frame.size.height-height);
  11. frame.origin.y = offsetY;
  12. NSTimeInterval duration = animated ? kTabBarHiddenDuration : 0.0;
  13. [UIView animateWithDuration:duration animations:^{
  14. self.tabBar.frame = frame;
  15. }];
  16. }
  17. @end