tipsywacky
tipsywacky

Reputation: 3464

iOS camera UIView overlay full screen on iPad?

I'm trying to make an overlay on the camera mode on iPad. when the camera is in landscape mode, the overlay only covers 2/3 of the screen instead of the full screen. It is covering the whole screen in portrait mode however. My guess is the overlay could possibly be only showing in portrait size so that the overlay doesn't appear to be covering the full screen.

UIView *overlay = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

overlay.backgroundColor = [UIColor blueColor];
overlay.alpha = 0.3; 
overlay.opaque = NO;

imagePicker.mediaTypes = mediaTypes;
imagePicker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
imagePicker.modalPresentationStyle = UIModalPresentationFullScreen;


imagePicker.cameraOverlayView = overlay;

However can i make it to cover the whole screen? Any help will be appreciated.

Upvotes: 0

Views: 3792

Answers (1)

Kapil Kumar
Kapil Kumar

Reputation: 104

Do manual setting for view frame. when it rotate to Portrait or Landscape.

For Portrait CGRectMake(0,0,768,1024);

For Landscape CGRectMake(0,0,1024,768);

Upvotes: 2

Related Questions