大佬教程收集整理的这篇文章主要介绍了objective-c – didRotateFromInterfaceOrientation:没有为在iOS 5上呈现模态控制器的控制器调用,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
>旋转后,模态控制器接收didRotateFromInterfaceOrientation:
>在解除模态控制器之前,父控制器也接收didRotateFromInterfaceOrientation:但是,仅当基本SDK设置为4.3(或更低)时才会发生.如果将基本SDK设置为5,则父控制器不会收到此消息.在4.3中,我根据didRotateFromInterfaceOrientation:中的新方向更新了父接口,并且在隐藏模态控制器后显示正确,但是在iOS 5中,它没有被调用,并且在隐藏模态控制器后父接口被搞砸了.
那么,如果在模态控制器可见时旋转设备,我该怎么做才能正确地将父控制器的界面更新为新的方向?
//.h @interface SomeViewController - (void)layoutForInterfaceOrientation:(UIInterfaceOrientation)orientation; @end //.m @implementation SomeViewController - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation]; [self layoutForInterfaceOrientation:currentOrientation]; } - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toOrientation duration:(NSTimeInterval)duration { [self layoutForInterfaceOrientation:toOrientation]; } - (void)layoutForInterfaceOrientation:(UIInterfaceOrientation)orientation { // layout views } @end
以上是大佬教程为你收集整理的objective-c – didRotateFromInterfaceOrientation:没有为在iOS 5上呈现模态控制器的控制器调用全部内容,希望文章能够帮你解决objective-c – didRotateFromInterfaceOrientation:没有为在iOS 5上呈现模态控制器的控制器调用所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。