CameraKit / camerakit-ios

Library for iOS Camera API. Massively increase performance and ease of use within your next iOS Project.
Apache License 2.0
679 stars 81 forks source link

Camera not filling UIview #26

Open Sobhi-IOS opened 4 years ago

Sobhi-IOS commented 4 years ago

IMG_3412 Hellow @austinkettner

i need filling My CameraKit this UIView GrayColor

can you help me please

Sobhi-IOS commented 4 years ago

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()

            }
        }
nmaswood98 commented 4 years ago

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