iPhone SDK选项卡栏在方向更改时自动旋转 [英] iPhone sdk tab bar auto rotate on orientation change

查看:85
本文介绍了iPhone SDK选项卡栏在方向更改时自动旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,该应用程序具有标签栏控制器和标签栏控制器内的一些导航控制器.我通过扩展标签栏并实现了shouldAutoRotateOnOrientation Change方法并为希望显示为允许自动旋转的特定视图控制器返回YES来自定义标签栏.在我以编程方式更改选项卡栏的selectedIndex之前,此方法可以正常工作.一旦更改了标签栏的selectedIndex,标签栏控制器的shouldAutoRotateOnOrientation更改方法就会停止调用.能否请您说出问题所在?从我更改标签栏的selectedIndex以来,应该将shouldAutoRotate方法传递给其他一些viewcontroller对象吗?

I have a an application that has a tabbar controller and some navigation controllers inside the tab bar controller. I customized the tab bar by extending it and implementing the shouldAutoRotateOnOrientation Change method and returning YES for specific view controllers that I wish to show allow auto rotation. This works fine until I programatically change the selectedIndex of the tabbar. Once I change the selectedIndex of the tabbar, the tabbar controller's shouldAutoRotateOnOrientation change methods stops getting called. Can you please say what might have been the problem and is the shouldAutoRotate method being delivered to some other viewcontroller object from when I change the selectedIndex of the tabbar?

推荐答案

您确定要在tabBarController中更改的selectedIndex对应于您希望允许自动旋转的视图控制器吗?.

Are you sure that the selectedIndex you are changing in the tabBarController corresponds to a View Controller that you wish to allow auto rotation?.

这篇关于iPhone SDK选项卡栏在方向更改时自动旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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