Search code examples
iosswiftstoryboard

Remove gray space on the bottom of the view


I have a project that starts the camera and capture frames with AVCaptureOutput. At the bottom of the screen I can see a gray space. The area is also visible on the storyboard. How can I remove that area to make the cameraView use the full screen?

Storyboard


Solution

  • You have set the bottom constraints of your view to the bottom constraint of the safeAreaLayoutGuide.

    Remove that constraint, drag the view's bottom edge until it touches the bottom of the main view. Then add a new bottom constraint to the view. Since you've dragged it to the bottom, the view's new bottom constraint should be constrained to the main view's bottom constraint.

    As show in the image below, the bottom constraint should show it is constrained to the superview and not Safe Area Bottom constraint to Superview