iOS相机UIView在iPad上全屏覆盖? [英] iOS camera UIView overlay full screen on iPad?

查看:120
本文介绍了iOS相机UIView在iPad上全屏覆盖?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在iPad上对相机模式进行叠加。当相机处于横向模式时,覆盖仅覆盖屏幕的2/3而不是全屏。然而,它以纵向模式覆盖整个屏幕。我的猜测是叠加层可能只显示纵向大小,因此叠加层似乎不会覆盖整个屏幕。

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.

推荐答案

对视图框进行手动设置。当它旋转到纵向或横向时。

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

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

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

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

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

这篇关于iOS相机UIView在iPad上全屏覆盖?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆