-1

I found an easy way to display the camera feed, but it shows above my XIB. How can I put the feed in a View to display under the buttons and background?

Here's my code.

//ViewController.m

FaceCamViewer *viewer3 = [[FaceCamViewer alloc] initWithFrame:CGRectMake(0, 0, 320, 568)];
viewer3.cameraType = AVCaptureDevicePositionFront;

AVCaptureSession *session = [[AVCaptureSession alloc] init];
viewer3.session = session; 

viewer3.draggable = NO;

[viewer3 startFaceCam];
[self.view addSubview:viewer3];

How do I create a property to access this through the XIB?

https://github.com/ijason/FaceCamTest

4

1 回答 1

1

您可以将一个简单的 UIView 添加到您的 XIB 文件中,将其放置在您喜欢的位置并创建一个属于它的属性。( @property IBOutlet UIView *faceView;) 在 Interface Builder 中将属性与视图挂钩,然后执行[self.faceView addSubview:viewer3];

于 2014-03-14T16:54:54.393 回答