如何在present出来的viewController里使用push方法
2019獨角獸企業重金招聘Python工程師標準>>>
? ?
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作為背景了,,,
轉載于:https://my.oschina.net/LangZiAiFer/blog/304869
總結
以上是生活随笔為你收集整理的如何在present出来的viewController里使用push方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 树莓派下的apache
- 下一篇: 各种排序算法及其java程序实现