![](/img/trans.png)
[英]How to pass the data from modally presented ViewController to another ViewController in Xamarin.iOS?
[英]iOS - Present viewcontroller from another presented viewcontroller
我有3个视图控制器A , B和C。 B出现在A上 。 我需要的是在按钮B上单击B并关闭B时,在A上显示C。 但是我做不到。 有一些解决方法。 感谢帮助。
在iOS5中单击B上的按钮,
UIViewController *presentingVC = self.presentingViewController;
[self dismissViewControllerAnimated:YES completion:^{
[presentingVC presentViewController:vc3 animated:YES completion:nil];
}];
当您单击B上的按钮时,弹出B本身并使用NSNotificationCenter向A发出通知,使A按下C。
如果您不想设置委托,只需通过B内部的presentingViewController属性获取A,则调用所需的A方法,在该方法中首先关闭模态控制器,然后显示C。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.