如何自定义相机屏幕框架? [英] How to customise the Camera screen frame?

查看:223
本文介绍了如何自定义相机屏幕框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用自定义框架来拍摄相机,这样我应该能够在同一个视图中显示 UIsearchBar ,并触摸 UISearchBar 我需要关闭相机,但 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?

推荐答案

你基本上有两个选项。最简单的方法是使用UIImagePickerController的cameraOverlayView属性。这可让您在相机顶部显示视图:

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

如果你需要更复杂的东西,你可以使用AVFoundation框架。简而言之,它将允许您在视图中任意位置显示摄像机流:
http://developer.apple.com/library/IOS/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html #// apple_ref / doc / uid / TP40010188-CH5-SW2

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

这是一个简单的教程,介绍如何使用AVFoundation拍摄照片: http://www.musicalgeometry.com/?p=1297

Here is a simple tutorial on how to take a picture with AVFoundation: http://www.musicalgeometry.com/?p=1297

这篇关于如何自定义相机屏幕框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆