我使用UIImagePickerViewController& amp;试图覆盖另一个视图。我已经设置了横向模式的叠加视图但是在叠加到摄像机视图后它仍然以纵向模式显示。
答案 0 :(得分:0)
我通过旋转叠加视图解决了这个问题,如下所示:tmpCamera.cameraOverlayView.transform = CGAffineTransformRotate(CGAffineTransformIdentity,117.81);希望这能节省时间:)
答案 1 :(得分:0)
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];
}