简体   繁体   English

dismissModalViewControllerAnimated也关闭调用它的视图控制器

[英]dismissModalViewControllerAnimated also dismisses the view controller that calls it

I've got a view controller which is presented as a modal view controller on startup by the delegate. 我有一个视图控制器,它在委托启动时作为模态视图控制器呈现。 This view controller has an option to select an image using a UIImagePickerController which is presented using presentModalViewControllerAnimated . 该视图控制器具有使用UIImagePickerController选择图像的选项,该图像通过presentModalViewControllerAnimated呈现。 After this I implement the 在此之后,我实现了

imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 

method and call dismissModalViewControllerAnimated on it, but this dismisses both of the modal view controllers. 方法,并在其上调用dismissModalViewControllerAnimated ,但这会关闭两个模态视图控制器。 I can't seem to keep the first view controller open when the second is closed. 关闭第二个视图控制器后,我似乎无法保持第一个视图控制器处于打开状态。

Who are you calling dismissModalViewControllerAnimated on? 您在谁身上调用dismissModalViewControllerAnimated? You want to call it on the view controller that presented the modal view you want to dismiss. 您想在提供要关闭的模态视图的视图控制器上调用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 解除 UIImagePickerController 也解除呈现视图控制器 - Dismissing of UIImagePickerController dismisses presenting view controller also 使用dismissModalViewControllerAnimated而不取消分配模态视图控制器 - using dismissModalViewControllerAnimated without deallocating modal view controller UITableView在模态视图控制器关闭后不刷新 - UITableView Not refreshing after Modal View Controller dismisses dismissModalViewControllerAnimated向下移动视图 - dismissModalViewControllerAnimated shifts view down 使用dismissModalViewControllerAnimated刷新上一个视图 - Refresh previous view using dismissModalViewControllerAnimated 在iOS的模式视图中调用dismissModalViewControllerAnimated是否安全? - Is it safe to call dismissModalViewControllerAnimated within a modal view on iOS? 在dismissModalViewControllerAnimated之后将参数设置为超级视图 - Set parameter to super view after dismissModalViewControllerAnimated 连续模式视图控制器在dismissModalViewControllerAnimated上使应用程序崩溃 - Consecutive modal view controllers crashes the app on dismissModalViewControllerAnimated 在dismissModalViewControllerAnimated之后,父视图设置为全屏 - After dismissModalViewControllerAnimated the parent view is set to fullscreen 如何知道何时启动dismissModalViewControllerAnimated以及何时完成? - How to know when dismissModalViewControllerAnimated is initiated and also when it is done?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM