[英]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.