camerakit-ios
camerakit-ios copied to clipboard
Camera not filling UIview
Hellow @austinkettner
i need filling My CameraKit this UIView GrayColor
can you help me please
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()
}
}
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