草庐IT

shouldAutorotateToInterfaceOrient

全部标签

iOS 6 旋转 : supportedInterfaceOrientations doesn´t work?

我在使用iOS6SDK时遇到了这个问题:我有一些View应该允许旋转(例如视频View),而有些则不允许。现在我知道我必须检查应用程序的Info.plist中的所有方向,然后在每个ViewController中整理,应该发生什么。但它不起作用!该应用程序始终旋转到Info.plist中给出的方向。信息.plist:UISupportedInterfaceOrientationsUIInterfaceOrientationPortraitUIInterfaceOrientationLandscapeLeftUIInterfaceOrientationLandscapeRight任何不应允

iOS 6 旋转 : supportedInterfaceOrientations doesn´t work?

我在使用iOS6SDK时遇到了这个问题:我有一些View应该允许旋转(例如视频View),而有些则不允许。现在我知道我必须检查应用程序的Info.plist中的所有方向,然后在每个ViewController中整理,应该发生什么。但它不起作用!该应用程序始终旋转到Info.plist中给出的方向。信息.plist:UISupportedInterfaceOrientationsUIInterfaceOrientationPortraitUIInterfaceOrientationLandscapeLeftUIInterfaceOrientationLandscapeRight任何不应允

ios - UISplitViewController shouldAutorotateToInterfaceOrientation

我正在使用UISplitViewController,当我启动模拟器时,出现以下错误:“对于所有界面方向,ViewController从-shouldAutorotateToInterfaceOrientation:返回NO。它应该至少支持一种方向。”关于我为什么得到这个的任何想法?(我没有子类化splitviewController)。 最佳答案 SplitViewController内的所有ViewController都必须覆盖该方法。似乎在所有情况下至少有一个覆盖返回NO。要使其旋转到所有方向,请在所有覆盖中返回YES。

iOS - UISupportedInterfaceOrientations 和 shouldAutorotateToInterfaceOrientation

我正在寻找有关如何仅允许您的iOS应用程序使用某些方向的说明。我知道UISupportedInterfaceOrientations和shouldAutorotateToInterfaceOrientation但我对它们的用途以及它们如何组合在一起感到有点困惑。我试图使用UISupportedInterfaceOrientations只允许横向方向,这似乎没有影响,直到我研究它并读到它影响初始方向。对此进行测试后,我的应用程序似乎只能在横向模式下打开,但如果屏幕是纵向模式,则会快速旋转。我知道您可以使用shouldAutorotateToInterfaceOrientation来限制允

objective-c - shouldAutorotateToInterfaceOrientation 在启动时被调用两次

我正在从事iOS5目标项目。我的定位方法如下。-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{NSLog(@"MyOrientation");returnYES;}但是,当我的应用程序启动时,我的日志消息将在控制台上显示两次,即我的Orientation将显示两次。我正在模拟器中测试我的应用程序,这只是在启动时发生,甚至没有改变orientation然后甚至在改变方向时再次发生。即,(BOOL)shouldAutorotateToInterfaceOri

ios - 在 -shouldAutorotateToInterfaceOrientation : 中预测 UI 元素框架

是否可以查询(以编程方式,在运行时)导航栏和/或工具栏的高度/厚度是多少?也就是说,在为特定subview构建框架时,我想相对于导航栏和工具栏之间的可用空间设置它的框架。为了让它顺利,最好在shouldAutorotateToInterfaceOrientation:而不是didRotateFromInterfaceOrientation:中执行此操作,但值如self.navigationController.toolbar.frame.size.height在方向和设备之间是不同的。我想根据工具栏的厚度将计算我的新subview框架,并且我想在没有硬编码值(例如32pt、44pt等)

ios - 为什么 shouldAutorotateToInterfaceOrientation 方法标记为不可用?

我将此代码放入UIViewController子类:overridefuncshouldAutorotateToInterfaceOrientation(toInterfaceOrientation:UIInterfaceOrientation)->Bool{returntrue}我得到这个编译时错误:Cannotoverride'shouldAutorotateToInterfaceOrientation'whichhasbeenmarkedunavailable问题是什么,我该如何解决? 最佳答案 shouldAutorotat

ios - 在 iOS 6 中没有调用 shouldAutorotateToInterfaceOrientation

我正在使用MGSplitViewController并且我正在使用shouldAutorotateToInterfaceOrientation控制旋转时主ViewController的大小。在iOS5上一切正常,但在iOS6(模拟器和iPad)上一切正常shouldAutorotateToInterfaceOrientation永远不会被调用。这是一个我应该期望在iOS6的最终版本中修复的错误还是我不知道的某些东西已经改变了? 最佳答案 请仔细阅读本文,否则您可能会因为发疯、打架、摇晃、转动您的测试设备而失去生命的1-2天,就像动物
12