相机快门打开事件的回调
我一直在 UIImagePickerController 中工作,遇到一个问题,当源类型设置为相机(UIImagePickerControllerSourceTypeCamera)时,我需要在 UIImagePickerController 中打开相机快门时获得精确的时刻。
我做了一些谷歌搜索,发现没有人有如此奇怪的要求!
我查看了 UIImagePickerController 和 UIImagePickerControllerDelegate 的文档,希望获得一些指示相机快门打开事件的委托方法/回调,但没有找到任何。
有什么建议吗?
感谢您的帮助,
拉吉·帕万
I have been working around in UIImagePickerController and am struck with a problem where I need to get the precise moment when the camera shutter opens in UIImagePickerController when the source type is set to camera (UIImagePickerControllerSourceTypeCamera).
I have done some googling around and have realized that no one had such strange requirement!
I looked around the docs of UIImagePickerController and UIImagePickerControllerDelegate hoping to get some delegate method / callback indicating the camera shutter open event, but did not find any.
Any suggestions?
Thanks for any help,
Raj Pawan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
订阅:
这是虹膜打开动画开始的时间。如果你在这段时间添加一个cameraOverlayView,它将被虹膜正确遮盖。它与 PL…私人通知同时发布。这是一种记录在案的方法,不会带来应用程序被拒绝的风险。
Subscribe to:
This is when the iris open animation begins. If you add a cameraOverlayView during this time, it will be properly covered up by the iris. It is posted at the same time as that PL… private notification. This is a documented approach that does not risk app rejection.
解决方案是观察私有通知,正如本线程中讨论的那样:
检测 iPhone 上相机光圈何时打开。
The solution is to observe for a private notification, just as discussed in this thread:
Detecting when camera's iris is open on iPhone.
我的建议(我自己没有尝试过,但不明白为什么它不起作用):
UIImagePickerController
类子类化为您自己的类,并覆盖 viewWillAppear 和 viewDidAppear :这些方法将被触发当 UIImagePickerController 即将出现或确实出现时(例如,如果使用presentModalController
正确触发其显示)。My sugestion (didn't try it myself but don't see why it wouldn't work) :
UIImagePickerController
class into your own class, and override the viewWillAppear and viewDidAppear : those methods will be triggered when the UIImagePickerController is about to appear or does appear (if you trigger its display properly usingpresentModalController
for instance) .