繁体   English   中英

iPhone的“相机重叠”视图未在横向模式下显示

[英]Camera Overlay view not showing in Landscape mode for iPhone

我已经使用UIImagePickerViewController启动了相机并尝试覆盖另一个视图。 我已经为“风景”模式设置了“叠加”视图,但是在叠加到“相机”视图后,它仍以“人像”模式显示。

我已经解决了这个问题,方法是旋转叠加视图,如下所示:tmpCamera.cameraOverlayView.transform = CGAffineTransformRotate(CGAffineTransformIdentity,117.81); 希望这可以节省一些时间:)

   first you selected only potrait mode in app settting
then use this function in viewdidLoad
//Orientation View into LandScape Mode
    -(void)orientationToLandscape{
        CGAffineTransform rotateTransform;
        switch ([UIApplication sharedApplication].statusBarOrientation) {
            case UIInterfaceOrientationPortrait:
                rotateTransform = CGAffineTransformMakeRotation(-90*M_PI/180.0);
                break;
            case UIInterfaceOrientationPortraitUpsideDown:
                rotateTransform = CGAffineTransformMakeRotation(90*M_PI/180.0);
                break;

            default:
                rotateTransform = CGAffineTransformMakeRotation(0);
                break;
        }

        rotateTransform = CGAffineTransformTranslate(rotateTransform, +90.0, +90.0);
        [self.view setTransform:rotateTransform];


    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM