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];
}