added additional contraints on cameraView
This commit is contained in:
parent
a96dab057a
commit
0c7bc6806a
|
@ -37,9 +37,21 @@ class ViewController: UIViewController {
|
||||||
self.lindera.delegate = linderaDelegate
|
self.lindera.delegate = linderaDelegate
|
||||||
|
|
||||||
// add lindera camera view to our app's UIView i.e. liveView
|
// add lindera camera view to our app's UIView i.e. liveView
|
||||||
self.liveView?.addSubview(lindera.cameraView)
|
|
||||||
// Expand our cameraView frame to liveView frame
|
// Expand our cameraView frame to liveView frame
|
||||||
lindera.cameraView.frame = self.liveView!.bounds;
|
if let view = self.liveView{
|
||||||
|
view.addSubview(lindera.cameraView)
|
||||||
|
self.lindera.cameraView.frame = view.bounds
|
||||||
|
|
||||||
|
self.lindera.cameraView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
NSLayoutConstraint.activate([
|
||||||
|
self.lindera.cameraView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
||||||
|
self.lindera.cameraView.topAnchor.constraint(equalTo: view.topAnchor),
|
||||||
|
self.lindera.cameraView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
||||||
|
self.lindera.cameraView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
lindera.startCamera()
|
lindera.startCamera()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user