Home how to insert image on imagepickercontroller (swift4)
Reply: 0

how to insert image on imagepickercontroller (swift4)

Sam Burns
1#
Sam Burns Published in 2017-12-07 22:25:08Z

My code below uses frame to print a red border around the image Picker. I want to do the same thing expect print a image right in the middle where blockview1 currently is.

@IBAction func takePhoto(_ sender: UIButton) {
    imagePicker =  UIImagePickerController()
    imagePicker.delegate = self
    imagePicker.sourceType = .camera
    present(imagePicker, animated: true, completion: nil)

    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: 980, y: 138, width: 100, height: self.view.frame.size.height + 999))
    blockView1.backgroundColor = UIColor.red

    blockView1.backgroundColor = UIColor.yellow
    mainView.addSubview(blockView2)

    blockView1.alpha = 0.7

    mainView.addSubview(blockView)
    mainView.addSubview(blockView1)

    imagePicker.cameraOverlayView = mainView
}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.566665 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO