iOS相机UIView覆盖iPad上的全屏吗?

我试图在iPad上对相机模式进行叠加。 当相机处于横向模式时,覆盖层仅覆盖屏幕的2/3而不是全屏。 但是它以纵向模式覆盖整个屏幕。 我的猜测是覆盖层可能只能以纵向尺寸显示,这样覆盖层看起来不会覆盖整个屏幕。

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; 

但是,我可以把它覆盖整个屏幕? 任何帮助将不胜感激。

做视图框架的手动设置。 当它旋转到肖像或风景。

对于CGRectMake(0,0,768,1024);

景观CGRectMake(0,0,1024,768);