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 没有按预期工作


- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- android 4中的android RadioButton问题 2022-01-01