繁体   English   中英

Ipad Simulator无法自动旋转

[英]Ipad Simulator not auto rotating

我有一个iPhone应用程序,正在使用shouldAutorotateToInterfaceOrientation确定何时自动旋转。 在iphone上,我指定UIInterfaceOrientationPortrait是唯一允许的方向。 在iPad上,我只返回YES(即全部允许),如下所示:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) //also tried using [[UIDevice currentDevice] userInterfaceIdiom] to no avail
  return YES; //doesn't get here
 return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

这在选项卡栏的每个视图控制器中。 当我通过NSLog() [[UIDevice currentDevice] userInterfaceIdiom] ,它返回0(或UIUserInterfaceIdiomPhone )。

iPad模拟器是否总是返回UIUserInterfaceIdiomPhone

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM