但是,当用户旋转设备时,我的视图控制器中没有得到willRotatetoInterfaceOrIEntation事件.所以我尝试做了建议here:我添加了我的视图控制器作为app委托中窗口的根视图控制器的子视图,但我的willRotatetoInterfaceOrIEntation仍未被调用.
我该怎么办?
解决方法 您的rootVIEwController充当容器视图控制器.In iOS 5.0 and later,custom UIVIEwController subclasses can Now act as container vIEw controllers. The UINavigationController and UITabbarController classes are examples of container vIEw controllers provIDed by UIKit. The IDea behind a container vIEw controller is that it manages the presentation of the content from its contained vIEw controllers,also kNown as its child vIEw controllers. The child content can be presented as-is or in conjunction with other other custom vIEws managed by the container vIEw controller.
您正在做的是实现自己的视图层次结构,因此您负责沿着该层次结构传递UIlifecycle-Events. iOS> = 5.0支持您创建此类容器vIEwControllers,提供
- (voID)addChildVIEwController:(UIVIEwController *)childController- (BOol)automaticallyForwardAppearanceAndRotationMethodstochildVIEwControllers
方法(等等).对于iOS< 5.0遗憾的是你必须手动执行此 *** 作.
总结以上是内存溢出为你收集整理的ios – UIViewController里面的一个根ViewController不能旋转全部内容,希望文章能够帮你解决ios – UIViewController里面的一个根ViewController不能旋转所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)