ios - 关闭从不同方法呈现的视图控制器
问题描述
我正在尝试使用一种方法呈现自定义 UIViewController 并从另一种方法中关闭相同的 UIViewController。
用于呈现控制器的方法:
-(void)presentViewController {
self.customView = [[UIViewController alloc] init];
[self.customView setModalPresentationStyle: UIModalPresentationOverFullScreen];
[self presentViewController:self.customView animated:YES completion:nil];
}
用于关闭控制器的方法:
-(void)dismissViewController {
[self.customView dismissViewControllerAnimated:YES completion:nil];
}
在 my 中创建一个customView
调用的按钮时dismissViewController
,没有任何反应。我知道该方法被调用是因为completion:
标签正在工作,但视觉上没有任何反应。也没有错误被打印到控制台。
也许我做错了整件事,但感谢任何帮助!只是想学习。
解决方案
推荐阅读
- javascript - 如何在 Highcharts 上的 xAxis 中显示 24 小时
- java - 将嵌套的 Json 对象的一部分转换为 Java Map
- kafka-consumer-api - 如何使用 KStreams 将不同的消息组合成 1 条输出消息?
- google-chrome-extension - 一个 URL 的 Chrome API 代理(只有一个特定的 URL)
- javascript - 使用聚合的 MongoDB 中的嵌套数组中的 getBypage
- reactjs - 反应原生firebase如何使查询同步
- php - laravel : laravel 中两个不同的 authcontroller jwt 身份验证令牌
- c - 如何在函数中传递结构数组?
- html - 未选择任何选项时在 HTML 选择中显示“占位符”
- ios - 通过 Facebook 登录移动应用程序时遇到问题