Overlay tabbar with a view

前端 未结 3 673
情书的邮戳
情书的邮戳 2021-01-24 00:21

I have a UIViewController inside Tab bar. For one VC in Tab bar I allow the interface to rotate upon device rotation. The challenge is, that I want to hide the Tab

3条回答
  •  悲&欢浪女
    2021-01-24 00:48

    [self hideTabBar:self.tabBarController];
    
    
    - (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];    
    }
    

提交回复
热议问题