1

我有一个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];

可以帮忙,但我无法将相机放在盒子里,我怎么能做到这一点?

4

0 回答 0