0

大家好我正在开发标签栏应用程序,我想在其中只支持第一个视图而不是所有标签视图的横向,只有一个标签应该支持所有方向,其余标签应该只支持纵向,我试过下面的代码在 FirstView.m 中

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}

在 secondView.m

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
return(interfaceOrientation == UIInterfaceOrientationPortrait);
}

它不允许我在任何选项卡视图中横向显示任何 1 可以帮助我吗?提前致谢

4

2 回答 2

0

阅读(BOOL)shouldAutorotateToInterfaceOrientationiOS 5 中的方法

于 2012-10-10T07:19:50.280 回答
0

您需要对您的接口进行 OR,而不是对它们进行 AND 操作。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
于 2012-10-10T07:47:16.663 回答