我注意到,在 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/