Tab bar disappears after segue

元气小坏坏 提交于 2019-12-25 06:58:08

问题


Update:

i hope this helps. a b c d are the buttons in the tabbar. viewcontroller1 is segued by b --> no tabbar. the same with viewcontroller2, which is segued from viewcontroller1

Tabbar Controller
     I
     I_____ a
     I
     I_____ b ---- viewcontoller1 
     I                   I
     I_____ c            I__viewcontroller2
     I
     I_____ d

Ive searched for solutions, but no approaches helped me.

In my app i have as initial view a tab bar controller. this tab bar has 4 views. I want to switch from one of these views to another view.

Therefore im using segues. After presenting the destination view, there is no tabbar anymore.

In the storyboard im using adaptives segues --> show (e.g. push)

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo{
    [picker dismissViewControllerAnimated:NO completion:NULL];
    self->takenImage = image;
    double delayInSeconds = 0.5;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

        [self performSegueWithIdentifier:@"OrtToBulldDetail" sender:self];

    });
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    if ([segue.identifier isEqualToString:@"OrtToBulldDetail"]){
        BuildDetailView *editViewController =
        (BuildDetailView *)segue.destinationViewController;
        [editViewController setMyImage:takenImage];
    }
} 

I also tried to use a navigation controller, but the destination view was load twice and my status bar was overlayed from another statusbar..

so where does my tabbar go? How can i get it back?


回答1:


If you don't use a navigation controller, then a "Show" segue presents the controller modally which covers the entire screen, including the tab bar. You should embed the b controller in a navigation controller, then the "Show" segue will do a push to viewcontroller1.

I_____ UINavigationController------b ---- viewcontoller1



来源:https://stackoverflow.com/questions/27698195/tab-bar-disappears-after-segue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!