camerakit-ios icon indicating copy to clipboard operation
camerakit-ios copied to clipboard

Camera not filling UIview

Open Sobhi-IOS opened this issue 4 years ago • 2 comments

IMG_3412 Hellow @austinkettner

i need filling My CameraKit this UIView GrayColor

can you help me please

Sobhi-IOS avatar Jan 13 '20 09:01 Sobhi-IOS

My Code

var previewView: CKFPreviewView = CKFPreviewView() var cameraSession: CKFVideoSession = CKFVideoSession()

in viewDidload() self.previewView.session = self.CameraPhotoSession self.CameraPhotoSession.resolution = CGSize(width: self.capturePreviewView.width, height: self.capturePreviewView.height) self.capturePreviewView.addSubview(self.previewView) self.previewView.snp.makeConstraints { (make) in make.edges.equalToSuperview()

            }
        }

Sobhi-IOS avatar Jan 13 '20 09:01 Sobhi-IOS

I was trying to get my cameraVIew to expand horizontally but it should work the same vertically also if thats what you need.

Just add this and then you should be able to resize it to any dimensions.

previewView.previewLayer?.videoGravity = .resizeAspectFill

nmaswood98 avatar Jan 29 '20 05:01 nmaswood98