如何在present出来的viewController里使用push方法

一世执手 提交于 2019-12-05 04:29:02

   

MenuViewController * menuViewController = [[MenuViewController alloc] init];

    menuViewController.delegate = self;

    UIViewController * controller = self.view.window.rootViewController;

    controller.modalPresentationStyle = UIModalPresentationCurrentContext;

    menuViewController.view.backgroundColor = [UIColor clearColor];

    menuViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

    UINavigationController * jackNavigationController = [[UINavigationController alloc] initWithRootViewController:menuViewController];

imageNamed:@"navigationBar_bg.png"] forBarMetrics:UIBarMetricsDefault];

    [self presentViewController:jackNavigationController animated:YES completion:^{

     }];

这样你就可以在present出来的viewController里畅通使用push方法退出其他界面了。

对了,

UIViewController * controller = self.view.window.rootViewController;

    controller.modalPresentationStyle = UIModalPresentationCurrentContext;

这两句是在第二个UIViewController中可以设置alph看到第一个UIViewController的界面;也就是第一个UIViewController作为背景了,,,

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