Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [self.tabBarController.tabBar setHidden:YES];
- [self.window addSubview:self.tabBarController.view];
- - (void)hideTabBar:(UITabBarController *) tabbarcontroller
- {
- [UIView beginAnimations:nil context:NULL];
- [UIView setAnimationDuration:0.5];
- for(UIView *view in tabbarcontroller.view.subviews)
- {
- if([view isKindOfClass:[UITabBar class]])
- {
- [view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
- }
- else
- {
- [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
- }
- }
- [UIView commitAnimations];
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.hidesBottomBarWhenPushed = YES;
- }
- - (void)hideTabBar{
- for (UIView *view in self.tabBarController.view.subviews) {
- if ([view isKindOfClass:[UITabBar class]]) {
- view.frame = CGRectMake(view.frame.origin.x,
- [UIScreen mainScreen].bounds.size.height,
- view.frame.size.width,
- view.frame.size.height);
- } else {
- view.frame = CGRectMake(view.frame.origin.x,
- view.frame.origin.y,
- view.frame.size.width,
- [UIScreen mainScreen].bounds.size.height);
- }
- }
- }
- - (void) showTabBar {
- for (UIView *view in self.tabBarController.view.subviews) {
- if ([view isKindOfClass:[UITabBar class]]) {
- view.frame = CGRectMake(view.frame.origin.x,
- [UIScreen mainScreen].bounds.size.height - 49,
- view.frame.size.width,
- view.frame.size.height);
- } else {
- view.frame = CGRectMake(view.frame.origin.x,
- view.frame.origin.y,
- view.frame.size.width,
- [UIScreen mainScreen].bounds.size.height - 49);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement