TabBar从纵向旋转到横向

时间:2010-10-06 05:48:44

标签: iphone

我正在制作基于TabBar的通用应用。我添加了一些额外的选项卡,并将viewController更改为navigationController。现在,当我尝试将视图从纵向旋转到横向时,它会旋转内部视图,但tabBar不会旋转,它会停留在相同位置,即纵向模式的底部,而其他所有UI都正常旋转。

1 个答案:

答案 0 :(得分:0)

确保控制器不支持旋转(分别是其所有者)覆盖shouldAutorotateToInterfaceOrientation并为所有方向返回YES。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
#pragma unused(interfaceOrientation)
    // Overriden to allow any orientation.
    return YES;
}

http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW23

相关问题