想要从当前视图推送另一个视图(Want to Push another View from current view)

编程入门 行业动态 更新时间:2024-10-18 21:19:46
想要从当前视图推送另一个视图(Want to Push another View from current view)

我正在进行paypal集成,我的项目运行良好。

但是我想从我当前的视图中推送我的下一个视图。 首先我使用了导航控制器,但现在我想推出导航控制器。

我用导航控制器的语法是

[self.navigationController pushViewController:[[[NextViewController alloc] initWithURL:[ECNetworkHandler sharedInstance].redirectURL returnURL:RETURN_URL cancelURL:CANCEL_URL] autorelease] animated:TRUE];

我使用语法推送另一个没有导航控制器的视图控制器

NextViewController *webVcustome = [[NextViewController alloc]initWithURL:[ECNetworkHandler sharedInstance].redirectURL returnURL:RETURN_URL cancelURL:CANCEL_URL]; [self.view addSubview:webVcustome.view];

使用导航它可以工作但没有导航它没有。

我该怎么做推动视图控制器。

I am doing paypal integration and my project is working good.

But i want to push my Next view from my current view. first i used Navigation Controller but now i want to push it with out navigation controller.

I used the syntax with Navigation controller is

[self.navigationController pushViewController:[[[NextViewController alloc] initWithURL:[ECNetworkHandler sharedInstance].redirectURL returnURL:RETURN_URL cancelURL:CANCEL_URL] autorelease] animated:TRUE];

And i used the syntax to push another view controller without navigation controller is

NextViewController *webVcustome = [[NextViewController alloc]initWithURL:[ECNetworkHandler sharedInstance].redirectURL returnURL:RETURN_URL cancelURL:CANCEL_URL]; [self.view addSubview:webVcustome.view];

With Navigation it works but without navigation it don't.

What should i do to push the view controller.

最满意答案

而不是添加子视图调用presentViewController:animated:completion ,如下所示:

[self presentViewController:webVcustome animated:YES completion:nil];

有关此消息的更多信息,请查看文档

instead of adding a subview call presentViewController:animated:completion, like this:

[self presentViewController:webVcustome animated:YES completion:nil];

for more information of this message take a look to the documentation

更多推荐

本文发布于:2023-04-27 12:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1326391.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   Push   View   current   view

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!