iOS的9方向自动旋转动画不工作,但总是在主线程 [英] iOS 9 Orientation Auto-Rotation Animation Not Working, But Always on Main Thread

查看:217
本文介绍了iOS的9方向自动旋转动画不工作,但总是在主线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的iOS 9.0(13A340)
X $ C $ 7.0Ç(7A220)
OS X 10.10.5(14F27)

iOS 9.0 (13A340) Xcode 7.0 (7A220) OS X 10.10.5 (14F27)

我在哪里,如果我旋转模拟器或设备(使用iPhone 6S SIM卡和iPhone 6+设备)的情况下,动画不还发生。我不确定为什么发生这种情况。我没有做任何不寻常或疯狂与任何的UIKit 方法,我不是要求不上主线程的任何方法。此外,我还添加了其他的UIView 动画也工作得很好。这仅仅是旋转的地方不对头。其他的应用程序似乎罚款。我不知道我可以做错误的。

I have a situation where if I rotate the simulator or device (using iPhone 6s sim and iPhone 6+ device), the animation does not also take place. I am unsure of why this is happening. I am not doing anything unusual or crazy with any UIKit methods, and I am not calling any method not on the main thread. Additionally, other UIView animations I have added appear to work just fine. It is just the rotation that's broken. Other apps seem fine. I'm not sure what I could be doing wrong.

无旋转动画

试图弄清楚/解决:


  • 这个扩展由Cocoanetics 来尝试看看如果任何的UIKit 执行是不是在主线程上。

  • 打印的值UIView.areAnimationsEnabled()在程序执行多点。它总是打印真正

  • 设置 UIView.setAnimationsEnabled(真)没修好。

  • Used this extension by Cocoanetics to attempt to see if any UIKit execution was not on the main thread.
  • Printed out the value of UIView.areAnimationsEnabled() during multiple spots in program execution. It always printed true.
  • Setting UIView.setAnimationsEnabled(true) did not fix.

我使用的是定制的导航视图控制器(一个我做了): SASlideDrawer (请注意我上午的不可以遇到了同样的问题单独项目)

I am using a custom "nav" view controller (one I made): SASlideDrawer (Note I am not experiencing this same issue with this project alone)

感谢您。

推荐答案

在我来说,我已经目标的主界面的设置,并在的application:didFinishLaunchingWithOptions:我一直创建新窗口和新的RootViewController的

In my case I had target's "Main Interface" set and in application:didFinishLaunchingWithOptions: I have been creating new window and new rootViewController

这篇关于iOS的9方向自动旋转动画不工作,但总是在主线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆