5

I see that by default, when displaying a UIImagePickerController with type camera, a black bar at the bottom of screen appears at the bottom.

I'd like to show a custom cameraOverlayView exactly on top and matching the dimensions of such black bottom bar, but I don't find a way of getting its height.

EDIT: alternatively, how could I calculate a cameraViewTransform keeping the aspect ratio of the camera view in such way the black bottom will have a certain height I can choose?

EDIT 2: Is that black bottom the same height for all devices?

AppsDev
  • 12,319
  • 23
  • 93
  • 186

1 Answers1

0

I Was facing same issue please use below code.

let screenSize = UIScreen.main.bounds.size
            let aspectRatio:CGFloat = 4.0/4.0
            let scale = screenSize.height/screenSize.width * aspectRatio
            imagePickers!.cameraViewTransform = CGAffineTransform(scaleX: scale, y: scale);
Dilip Mishra
  • 1,422
  • 13
  • 17