UITabBarController中的UIViewController和UISplitViewController shouldAutorotateToInterfaceOrientation

时间:2010-07-23 09:02:57

标签: ipad uiviewcontroller uitabbarcontroller rotation uisplitviewcontroller

我的iPad代码存在一些问题。

我有一个UITabBarController,它包含一些UIViewController和一个UISplitViewController。问题是UIViewController甚至UISplitViewController都没有正确识别方向更改。

我已经在我的TabBarController和所有UIViewControllers上设置了shouldAutorotateToInterfaceOrientation,但我意识到Top moast ViewController中只有willRotateToInterfaceOrientation会触发哪个是我的TabBarController。如果我从我的TabBarController中删除shouldAutorotateToInterfaceOrientation将调用来自我的子UIViewControllers的willRotateToInterfaceOrientation。最大的问题是我的UISplitViewController,因为它会旋转到新的interfaceOrientation但是它被困在他的Portrait Layout中。

如何使用ViewControllers和Splitviews正确实现TabBarController,包括方向更改?

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

请注意,UITabBarController类引用的第二句指出“此类不用于子类化。”

所以,虽然这种方法可行,但我怀疑它不是“正确的”。 (我也遇到了这个问题。)