如何在 UIView里用 pushViewController方法 转到 UIControllerView
1个回答
展开全部
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作为背景了,,,
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作为背景了,,,
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询