Created
July 14, 2014 04:00
-
-
Save akuraru/b275770e00743650d675 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation HideTabBar | |
+ (void)tabBarHidden:(BOOL)hide tabBar:(UITabBarController *)tabBarController { | |
CGFloat viewHeight = [self viewHeight:hide]; | |
for (UIView *view in tabBarController.view.subviews) { | |
CGRect _rect = view.frame; | |
if ([view isKindOfClass:[UITabBar class]]) { | |
_rect.origin.y = viewHeight; | |
} else { | |
_rect.size.height = viewHeight; | |
} | |
[view setFrame:_rect]; | |
} | |
} | |
+ (CGFloat)viewHeight:(BOOL)b { | |
return ([[UIScreen mainScreen] bounds].size.height - ((b) ? 0 : 49)); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment