123456789101112131415161718192021222324 |
-
- #import "RNNTabBarController.h"
- #define kTabBarHiddenDuration 0.3
-
- @implementation RNNTabBarController
-
- - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
- return self.selectedViewController.supportedInterfaceOrientations;
- }
-
- - (void)setTabBarHidden:(BOOL)hidden animated:(BOOL)animated {
- CGRect frame = self.tabBar.frame;
- CGFloat height = frame.size.height;
- CGFloat offsetY = (hidden ? self.view.frame.size.height : self.view.frame.size.height-height);
- frame.origin.y = offsetY;
- NSTimeInterval duration = animated ? kTabBarHiddenDuration : 0.0;
-
- [UIView animateWithDuration:duration animations:^{
- self.tabBar.frame = frame;
- }];
- }
-
- @end
|