iOS   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了rotation – 支持tabbarcontroller iOS 6中morenavigationcontroller和children viewcontroller中的所有方向大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个tabbar应用程序.我通过将标签栏控制器设置为窗口根视图控制器,然后通过子类别覆盖navigationcontroller和tabBAController的行为来修改标签的方向(然不推荐).
 现在,除了更多导航控制器及其子视图控制器之外,所有选项卡都可以使用方向.我知道问题是设备旋转通知没有传递给tab栏控制器中morenavigationcontroller里面的子视图控制器.
此外,更多的navigationcontroller是readonly属性.

我的问题是我想在morenavigationcontroller和子视图控制器中支持所有方向.现在shoulautorotate内部的子视图控制器没有被调用更多导航控制器.

解决方法

在iOS 6之后,Apple改变了应用程序中的方向.请看下面的帖子.这是非常有帮助的

Tabbar controller with navigationcontrollers orientation ios 6

或者,您可以创建自定义tabbarcontroller并实现以下方法

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // You do not need this method if you are not supporTing earlier iOS Versions
    return [self.SELEctedViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}

-(NSUInteger)supportedInterfaceOrientations
{
    return [self.SELEctedViewController supportedInterfaceOrientations];
}

-(BOOL)shouldAutorotate
{
    return YES;
}

大佬总结

以上是大佬教程为你收集整理的rotation – 支持tabbarcontroller iOS 6中morenavigationcontroller和children viewcontroller中的所有方向全部内容,希望文章能够帮你解决rotation – 支持tabbarcontroller iOS 6中morenavigationcontroller和children viewcontroller中的所有方向所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。