1
我已经使用UIImagePickerViewController &尝试覆盖另一个视图。我为横向模式设置了叠加视图但是仍然在叠加到相机视图之后以纵向模式显示。摄像头覆盖视图不能在横向模式下显示iPhone
我已经使用UIImagePickerViewController &尝试覆盖另一个视图。我为横向模式设置了叠加视图但是仍然在叠加到相机视图之后以纵向模式显示。摄像头覆盖视图不能在横向模式下显示iPhone
我已经解决了这个问题,通过旋转覆盖视图如下,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];
}