UISplitViewController rotation iOS8 not working as expected(UISplitViewController 旋转 iOS8 没有按预期工作)
问题描述
如果我创建一个新的基于 UISplitViewController 的项目并将几个容器视图添加到详细视图控制器,我可以使容器视图的旋转正常工作,并且它在没有任何代码实现旋转的情况下做到这一点,它似乎可以解决这个包可以这么说,真的很棒.谁能解释为什么这有效?但是当我在没有适当 iOS 8 旋转方法的现有应用程序上尝试它时,它根本不旋转?
If I create a new UISplitViewController based project and add a couple of container views to the detail viewController, I can get rotation working properly for the container views and it does this without any code implementing rotation, it just seems to work out of the bag so to speak, which is really great. Can anyone explain why this works? but when I try it on an existing app without appropriate iOS 8 rotation methods it doesn't rotate at all?
推荐答案
不确定这是否是您的问题,但很可能是.
Not sure if this is your issue, but could well be it.
iOS8 和较旧的 xcode 项目在运行时不改变方向存在一个常见问题.只影响iOS8.
There is a common problem with iOS8 and older xcode projects not changing orientation when run. Only affects iOS8.
这似乎是由于旧的 xcode 用于生成的剩余代码行,而最新的 xcode 没有检测到或警告您.
This seems to be due to a leftover line of code older xcodes used to generate and the latest xcode does not detect or warn you about.
违规行将在您的 AppDelegate didFinishLaunchingWithOptions
函数中,如下所示:
The offending line will be in your AppDelegate didFinishLaunchingWithOptions
function and looks like the following:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
如果它存在,请将其注释掉,并且旋转应该开始工作.
Comment this out if it is there and rotation should start working.
这篇关于UISplitViewController 旋转 iOS8 没有按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:UISplitViewController 旋转 iOS8 没有按预期工作
基础教程推荐
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01