在開發(fā)過程中馍资,經(jīng)常會(huì)遇到這樣跳轉(zhuǎn)筒主,在自定義view、AppDelegate等地方鸟蟹,用push乌妙、present不能正常的跳轉(zhuǎn)。我總結(jié)了三種方法建钥。如果有其他更好的處理方式藤韵,記得告訴我哦!P芫泽艘!
#pragma mark ---- 跳轉(zhuǎn)控制器的方法 ---
-(void)jumpViewController
{
MoreViewController *more = [[MoreViewController alloc]init];
UIApplication *app =[UIApplication sharedApplication];
AppDelegate *app2 = app.delegate;
UINavigationController *nav =[[UINavigationController alloc]initWithRootViewController:more];
app2.window.rootViewController = nav;
app2.window.rootViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl;
}
//跳轉(zhuǎn)控制器的方法2
-(void)jumpViewController2
{
ProjectDetailsViewCtl *vc = [[ProjectDetailsViewCtl alloc]init];
UINavigationController *nav =[[UINavigationController alloc]initWithRootViewController:vc];
nav.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
//[self.window.rootViewController presentViewController:nav animated:YES completion:nil];
[self presentViewController:nav animated:YES completion:nil];
}
-(void)navLeftBarAction {
// 返回 用dismiss
[self dismissViewControllerAnimated:YES completion:nil];
}
//跳轉(zhuǎn)控制器的方法2
-(void)jumpViewController3
{
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:vc animated:YES completion:nil];
}