如何自定义相机屏幕边框?
我想启动具有自定义框架的相机,以便我应该能够在同一视图中显示 UIsearchBar
,并且在触摸 UISearchBar
时我需要关闭相机,但是 < code>UIsearchBar 应该可见。所以我想停止相机将整个iPhone屏幕作为一个框架。 所以我想知道如何自定义相机屏幕?
I want to lauch camera with customised frame so that I should be able to show UIsearchBar
in the same View and on touching the UISearchBar
I need to close the camera, but the UIsearchBar
should be visible. So I want to stop the camera to take the full iPhone screen as a frame.
So I want to know how to customise the Camera Screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你基本上有两个选择。最简单的一种是使用UIImagePickerController 的cameraOverlayView 属性。这允许您在相机顶部显示视图:
http://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/occ/instp/UIImagePickerController/cameraOverlayView
如果您需要更复杂的东西,您可以使用 AVFoundation 框架。简而言之,它将允许您在视图中的任何位置显示相机流:
<一href="http://developer.apple.com/library/IOS/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW2 ">http://developer.apple.com/library/IOS/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW2
以下是有关如何使用 AVFoundation 拍照的简单教程:http://www.musicalgeometry.com/?p=1297< /a>
You basically have two options. The easiest one is to use the cameraOverlayView property of the UIImagePickerController. This allows you to display a view on top of the camera:
http://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/occ/instp/UIImagePickerController/cameraOverlayView
If you need something more elaborate you can use the AVFoundation framework. In short, it will allow you to display the camera stream anywhere you want in a view:
http://developer.apple.com/library/IOS/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW2
Here is a simple tutorial on how to take a picture with AVFoundation: http://www.musicalgeometry.com/?p=1297