ios - how to make cameraOverlayView along the y axis (swift3) -




i making photo app want imagepicker screen have blocks of red pre mask photo before crops. following code gets roadblock on top x axis. place red box along entire y axis yellow rectangle is.

    let blockview = uiview.init(frame: cgrect.init(x: 0, y: 0, width: self.view.frame.size.width, height: 150))             blockview.backgroundcolor = uicolor.red      imagepicker.cameraoverlayview = blockview 

enter image description here

please try following :

let mainview = uiview.init(frame: cgrect.init(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height-150))  let blockview = uiview.init(frame: cgrect.init(x: 0, y: 0, width: self.view.frame.size.width, height: 150)) blockview.backgroundcolor = uicolor.red  let blockview1 = uiview.init(frame: cgrect.init(x: 0, y: 170, width: 100, height: self.view.frame.size.height-320)) blockview1.backgroundcolor = uicolor.green  mainview.addsubview(blockview) mainview.addsubview(blockview1)  imagepicker.cameraoverlayview = mainview 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -