Custom Push Segue removes navigation bar and tab bar in story board

前端 未结 3 895
孤城傲影
孤城傲影 2020-12-15 07:16

I have the following defined in a custom Segue, let us call it SegueX:

@interface SegueX : UIStoryboardSegue
@end

@implementation SegueX

- (void)perform
{
         


        
相关标签:
3条回答
  • 2020-12-15 07:49

    The navigation bar and the tool bar should disappear in the storyboard when you change the segue -- that's normal. You can change the simulated metrics for the bottom bar to "Translucent Toolbar", which will add it back, so you can add buttons to it (you only want to change the simulated metrics, not drag in another tool bar which would add a second tool bar). You should still see both bars with their buttons at run time.

    0 讨论(0)
  • 2020-12-15 07:54

    Try to check if you have set on storyboard an option like
    enter image description here
    That metrics are inferred on the pushed view controller (but I'm pretty sure it doesn't count).
    enter image description here

    And/or force the navigation bar and bottom bar to be visible programmatically using, inside the -viewWillAppear of the pushed view controller

    [self.navigationController setNavigationBarHidden:NO animated:NO];
    [self.navigationController setToolbarHidden:NO animated:NO];
    
    0 讨论(0)
  • 2020-12-15 08:07
    (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
        ViewController * controller = [[ViewController alloc]init];
        controller.hidesBottomBarWhenPushed=YES;
        if ([segue.identifier isEqualToString:@"Commentsegue"]) {
            //For hiding the tab bar 
            [segue.destinationViewController setHidesBottomBarWhenPushed:YES];
        } 
    }
    
    0 讨论(0)
提交回复
热议问题