UIView doesn't resize to full screen when hiding the nav bar & tab bar

后端 未结 15 1471
情歌与酒
情歌与酒 2020-12-02 07:28

I have an app that has a tab bar & nav bar for normal interaction. One of my screens is a large portion of text, so I allow the user to tap to go full screen (sort of l

相关标签:
15条回答
  • 2020-12-02 08:25

    Have you set your view controller's hidesBottomBarWhenPushed property to YES? You need to set this in your initWithNibName:bundle: or initWithCoder: method. When it gets pushed to the nav controller, this should hide the tab bar and make the content view extend down to the bottom.

    0 讨论(0)
  • 2020-12-02 08:27

    Put the code in a prepare for segue like this, works perfectly for me:

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
    if ([[segue identifier] isEqualToString:@"ViewPhoto"]) {
    
        ImageView *vc = [segue destinationViewController];
    
        NSInteger selectedIndex = [[self.tableView indexPathForSelectedRow] row];
    
            NSString *Title = [photoNames objectAtIndex:selectedIndex];
            [vc setSelectedTitle:[NSString stringWithFormat:@"%@", Title]];
    
            vc.hidesBottomBarWhenPushed = YES;
    
            }
        }
    
    0 讨论(0)
  • 2020-12-02 08:28

    If the UITabBarController is pushed by a rootViewController (navigationController). You can try the following:

    First hide the status Bar / Tab Bar;

    [self.navigationController pushViewController:aBlankViewController animated:NO];
    [self.navigationController popViewControllerAnimated:NO];
    

    You should be able to reclaim the white space, though the screen will shock during the adjustment...

    0 讨论(0)
提交回复
热议问题