Is it possible to hide the tabbar when a button is pressed to allow a full screen view of the content?

后端 未结 6 1660
情书的邮戳
情书的邮戳 2020-11-29 22:21

I have a UITabBar in the detail view of my navigation based application. I am storing text and images in a tableview and would like the user to be able to tap on a cell to

6条回答
  •  天命终不由人
    2020-11-29 22:59

    My solution:

    // Hide tab bar animated
    CATransition *animation = [CATransition animation];
    [animation setType:kCATransitionFade];
    [[self.view.window layer] addAnimation:animation forKey:@"layerAnimation"]; 
    [self.tabBarController.tabBar setHidden:YES];
    
    // Display tab bar animated
    CATransition *animation = [CATransition animation];
    [animation setType:kCATransitionFade];
    [[self.view.window layer] addAnimation:animation forKey:@"layerAnimation"]; 
    [self.tabBarController.tabBar setHidden:NO];
    

    You have to add #import

提交回复
热议问题