【问题标题】:Ipad Simulator not auto rotatingIpad模拟器不自动旋转
【发布时间】:2011-04-07 23:09:29
【问题描述】:

我有一个 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

【问题讨论】:

标签: iphone cocoa-touch ipad orientation ios-simulator


【解决方案1】:

【讨论】:

  • 感谢您的链接 - 多次搜索都没有找到它。
猜你喜欢
  • 2014-02-21
  • 2014-08-27
  • 1970-01-01
  • 2011-04-07
  • 1970-01-01
  • 2013-07-31
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多