将相机插入UIViewController作为子视图

时间:2013-10-30 23:01:14

标签: ios uiviewcontroller

我有UIViewcontroller的照片框子视图,我需要在此框内插入相机,我已在网上搜索,我发现AVCaptureVideoPreviewLayer

  

AVCaptureVideoPreviewLayer * newCaptureVideoPreviewLayer =   [[AVCaptureVideoPreviewLayer alloc] initWithSession:session];

     

[self.view.layer addSublayer:newCaptureVideoPreviewLayer];

UIImagePickerController

  

self.picker = [[UIImagePickerController alloc] init];

     

[self.view addSubview:self.picker.view];

可以提供帮助,但我无法将相机放入包装盒内,我该怎样才能实现这一目标?

0 个答案:

没有答案