如何响应 UIImagePickerController 生成的 UIAlertView [英] How to respond to UIImagePickerController Generated UIAlertView

查看:16
本文介绍了如何响应 UIImagePickerController 生成的 UIAlertView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 UIImagePickerController 从我的应用程序中捕获视频,并且我已将视频最长持续时间设置为 30 秒.当达到 30 秒限制时.我收到一条消息达到最大视频录制限制"由 UIImagePickerController 生成,并且它停止捕获视频.

I am using UIImagePickerController to capture video from my app and i have set video maximum duration to 30 seconds. When that 30 seconds limit is reached. I get an alert with a message "maximum video recording limit reached" produced by UIImagePickerController and it stops capturing video.

我想要的是响应在达到 30 秒限制时自动生成的警报.当按下该警报的确定"按钮时,我想执行一些操作.我已经实现了 UIAlertView 的所有委托方法,但是当我按下 OK 按钮时,它确实出现在任何方法中.

What I want is that I want to respond to that alert that is generated automatically when 30 seconds limit is reached. I want to perform some action when "OK" button of that alert is pressed. I have implemented all the delegate methods of UIAlertView but it does come in any method when I press OK button.

请帮助我如何响应该警报?

Please help me how I can respond to that alert?

推荐答案

你不能使用所有这些委托方法,因为你没有启动 UIAlertView 所以你不能设置他的委托...

You can't use all those delegate methods because you didn't initiate the UIAlertView so you can't set his delegate...

我唯一能想到的就是做一些事情,比如听 UIWindowDidBecomeVisibleNotification 来检测警报何时显示,以及 UIWindowDidBecomeHiddenNotification 通知来检测它何时消失.

The only thing I can think about is to do somethong like listening to the UIWindowDidBecomeVisibleNotification to detect when an alert is shown and to the UIWindowDidBecomeHiddenNotification notification to detect when it disappears.

您应该知道这些通知将针对使用自己的 UIWindow 的所有类型的组件触发,例如 UIActionSheet 或键盘,因此您需要确保这是正确的(也许检查一下子视图之一中是否有 UIAlertView ..)

You should know that those notification will fire for all kind of components that uses their own UIWindow such as UIActionSheet or the keyboard, so you need to make sure this is the right one (maybe check to see if there is a UIAlertView in one of the subviews..)

这篇关于如何响应 UIImagePickerController 生成的 UIAlertView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆