在 Xcode 4 中重新启用横向
在修复图像问题时,我暂时禁用了 iPhone 应用程序中的横向功能。现在,在我的一生中,我无法让任何页面自动旋转到任一横向方向。以前工作得很好。我在 info.plist
的 UISupportedInterfaceOrientations
中确定了所有 4 个方向。所有 4 个方向均在支持的设备方向目标摘要中突出显示。我的实现文件都有:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
我确信我错过了一些愚蠢的东西,但在尝试了几个小时后我找不到它。有什么想法吗????
I temporarily disabled landscape orientations in my iPhone app while I fixed a problem with an image. Now, for the life of me, I can't get any pages to AutoRotate to either landscape orientation. It worked fine previously. I have all 4 orientations identified in the UISupportedInterfaceOrientations
in the info.plist
. All 4 orientations are highlighted in the Targets Summary Supported Device Orientations. My implementation files all have:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
I'm sure it's something stupid I'm missing, but I can't find it after trying for hours. Any thoughts????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您确定每个 viewController 都有
,那么您可能需要尝试删除
Build/
目录,在构建选项中选择clean all Targets
,然后重新启动应用程序。有时这会产生奇迹般的效果。另外,关闭并重新打开模拟器和/或 Xcode 对我来说是一个常见的神秘解决方案。如果这不起作用,那么您可能需要阅读 Apple 的故障排除指南: 为什么我的 UIViewController 不会随设备旋转?
If you are certain that each viewController has
then you may want to try deleting the
Build/
directory, selectingclean all targets
in the build options, and then relaunching the app. Sometimes this miraculously works. Also, closing and re-opening the simulator and/or Xcode is a common mystery solution for me.If this doesn't work, then you may want to read through Apple's trouble shooting guide: Why won't my UIViewController rotate with the device?
您可能想要清理所有目标 - 更新的 plist 可能不会复制到应用程序包中。如果设备上有此应用程序,您也可以尝试从设备中删除该应用程序。
You may want to clean all targets - the updated plist may not be getting copied into the app bundle. If this is on the device, you may try deleting the app from the device as well.