更改模式 UIImagePickerController 父视图
我正在尝试构建一个在第一个视图上有一个按钮的应用程序,当您点击该按钮时,它会显示 UIImagePickerController
模式视图。我理想的情况是,一旦您拍照,当模态视图被关闭时,呈现图像选择器的原始视图就会发生变化。
例如,该过程将是 VIEW 1 --(点击按钮) -->模态图像选择器 --(关闭模态视图)--> VIEW 2.
到目前为止,我已经让应用程序加载 UIImagePickerController
,一旦完成,在 didFinishPickingMediaWithInfo
委托方法中,它会设置一个 BOOL
值为 YES
,然后在我的原始视图 (VIEW 1) 的 ViewDidAppear
中,它会在下一个视图中呈现一个新的模式。
这样做的问题是关闭模态视图和下一个视图(VIEW 2)出现之间存在延迟。
有谁知道以上是否可行?如果没有,我可能不得不在图像选择器关闭和第二个视图出现之间显示一个旋转器并说“处理图像”。
I'm trying to build an app that features a button on the first view, when you tap the button it presents the UIImagePickerController
modal view. What I would ideally like is once you have taken you photo, when the modal view is dismissed, the original view which presented the image picker changes.
For example, the process would be VIEW 1 -- (tap button) --> MODAL IMAGE PICKER -- (close modal view) --> VIEW 2.
So far I've got the app loading the UIImagePickerController
and once you are complete, within the didFinishPickingMediaWithInfo
delegate method, it sets a BOOL
value to YES
and then within the ViewDidAppear
of my original view (VIEW 1) it then presents a new modal with the next view.
The problem with this is that there is a delay between the closing the modal view and the next view (VIEW 2) appearing.
Does anyone know if the above is possible? If not, I might have to resort to displaying a spinner and saying "Processing image" between the image picker closing and the second view appearing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用导航控制器来解决这个问题。
创建一个导航控制器并将您的第一个控制器推入其中。稍后,从您的第一个控制器中,以模态方式呈现选择器。到目前为止几乎相同,只是我们添加了一个导航控制器。这就是我为了得到你想要的结果所做的。
希望这有帮助。
You can use a navigation controller to solve this problem.
Create a navigation controller and push your first controller into it. Later from your first controller, present the picker modally. Pretty much the same until now except that we have added a navigation controller. This is what I did to get your desired result.
Hope this helps.