i have a view and would like the camera to display in the whole view in the grey area. currently it only display, shown in the black area.
[current situation faced]
i am using xcode
, swift 4
, for iOS 11
.
May I know how to make my camera view fill the grey part?
currently for my preview layer i did:
previewLayer = AVCaptureVideoPreviewLayer(session: captureSession)
self.previewLayer.frame = self.camView.layer.bounds
previewLayer.videoGravity = AVLayerVideoGravity.resizeAspectFill
self.camView.layer.insertSublayer(previewLayer!, at: 0)
I have also set constraint for bottom, left, right to be 0. Thank you.