如何自定义相机屏幕边框?

发布于 2024-12-02 23:14:20 字数 180 浏览 0 评论 0原文

我想启动具有自定义框架的相机,以便我应该能够在同一视图中显示 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲影 2024-12-09 23:14:20

你基本上有两个选择。最简单的一种是使用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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文