In iOS 6 shouldAutorotateToInterfaceOrientation没有用,但它在iOS 5.0或中工作正常5.1.
我应该需要改变什么iOS 6.这是我的代码
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if([[[SampleApplicationAppDelegate instance].callInfoDictionary valueForKey:IS_CHAT] isEqualToString:NO_RESPONSE])
{
int nAngle = 0;
BOOL bRet = NO;
switch (interfaceOrientation) {
case UIInterfaceOrientationPortrait:
nAngle = 90;
bRet = YES;
NSLog(@".......Preview = %f %f",_previewCamera.frame.size.width,_previewCamera.frame.size.height);
_previewCamera.transform = CGAffineTransformMakeRotation(M_PI*1.5);
NSLog(@"Preview = %f %f",_previewCamera.frame.size.width,_previewCamera.frame.size.height);
break;
case UIInterfaceOrientationPortraitUpsideDown:
nAngle = 270;
bRet = YES;
_previewCamera.transform = CGAffineTransformMakeRotation(M_PI_2);
break;
case UIInterfaceOrientationLandscapeLeft:
nAngle = 0;
bRet = YES;
//_previewCamera.transform = CGAffineTransformMakeRotation(M_PI*1.5);
break;
case UIInterfaceOrientationLandscapeRight:
nAngle …Run Code Online (Sandbox Code Playgroud) 我在浏览器中嵌入了Youtube视频,这是所有肖像应用程序的一部分.当您启动YouTube视频时,它将在MPAVController中播放并允许在Landscape中旋转.这对我来说不是问题,但问题是如果视频是横向的,我按"OK"关闭视频; 我返回浏览器,但iPhone状态栏现在停留在横向模式,在应用程序顶部留下一个空白区域,以及状态栏覆盖我的应用程序的右侧或左侧部分,具体取决于旋转方向.
包含UIWebView的视图控制器被纵向锁定:
- (BOOL) shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)
请注意,使用6.0之前的SDK进行编译时,不会出现此问题.
有类似问题的人有解决方案吗?
youtube iphone uiinterfaceorientation landscape-portrait ios6