Reputation: 1806
I am developing with AvCapture session to add cutom overlays on camera screen. I have added an AvCaptureVidePreview layer as
AvCaptureVideoPreviewLayer*layer = [[AvCaptureVideoPreviewLayer alloc] iniWithSession:session];
layer.frame = self.view.layer.bounds;
but the camera preview is not full screen in case of iPhone 4S. It works fine in iPhone 5.
Upvotes: 3
Views: 979
Reputation: 137
CGRect bounds=view.layer.bounds;
layer.videoGravity = AVLayerVideoGravityResizeAspectFill;
layer.bounds=bounds;
layer.position=CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));
may be it can help you..
Upvotes: 5