iphone - 相机叠加 View - 仅用于预览?

标签 iphone camera overlay uiimagepickercontroller

我注意到,在 OS 3.1 中,您可以使用

将叠加 View 添加到图像选择器
cameraOverlayView

但是,我还注意到,当我只想在预览阶段显示它时,通过此方法添加 View 也会在 UIImagePicker 显示的整个时间中显示该 View 。

有没有办法让它只在预览期间发生?我不希望它出现在打开快门动画或询问您是否要使用图像或重拍的屏幕中。

最佳答案

我只是想在没有 subview 的情况下展示另一种可能性。 CameraPicker 中的更改有系统通知。它们也没有记录(作为 subview 结构)。因此它们也可能会发生变化。但你明白了。

您可以不使用姓名进行注册:

[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(notificationReceived:) name: nil object: nil];

我们在这里收到一些有趣的(不言自明的)通知:

PLCameraControllerPreviewStartedNotification
PLCameraViewIrisAnimationWillBeginNotification
PLCameraViewIrisAnimationDidEndNotification

Recorder_DidStartPreviewing
Recorder_SourceStarted
Recorder_WillCapturePhoto
Recorder_DidCapturePhoto
Recorder_PhotoStillImageSampleBufferReady
Recorder_DidStopPreviewing

_UIImagePickerControllerUserDidCaptureItem // Photo was taken, preview is shown
_UIImagePickerControllerUserDidRejectItem  // Repeat was pressed, camera is shown again 

您可以使用它们来触发您的叠加 View 隐藏状态或其他任何内容。

关于iphone - 相机叠加 View - 仅用于预览?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2081872/

相关文章:

ios - iOS 中的泰米尔语字体

iphone - 如何将 : Get order of tabs, 保存到 NSUserDefaults 然后检索

Android 相机应用程序在返回和主页按钮上出现错误

android - MapItemizedOverlay 中的 OnTouchEvent

javascript - 具有深色不透明度的文本叠加图像 React Native

jquery - 使叠加层出现在悬停按钮上

iphone - 界面生成器 : Choose media based on target

iphone - Three20链接器错误

android - Camera intent.getData()在部分设备返回null,主要在android 7.0

HTML5 : camera access