1

在我的项目中,不在更多部分下的选项卡正确响应方向,但更多部分下的选项卡没有响应。例如,如果我在更多部分下有两个选项卡名称 tab1 和 tab2,并且如果我在每个选项卡的“shouldAutorotateToInterfaceOrientation”方法处放置断点。之后,如果我从更多部分中选择 tab1 并尝试旋转它但tab2 的“shouldAutorotateToInterfaceOrientation”被调用。我选择的选项卡的 delagate 方法没有被调用。我正在使用 XCode Ver 4.3.2。有人可以帮我解决这个问题吗..

在此先感谢 Prajnaranjan Das

4

3 回答 3

1

请编写标签栏控制器的所有根视图控制器的以下代码。

- (BOOL)shouldAutorotateToInterfaceOrientation:  (UIInterfaceOrientation)interfaceOrientation
{

 return yes;
}
于 2012-04-27T14:02:57.213 回答
1

我面临着和你现在面临的一样的prblm......

我向 tababarcontroller 中的所有视图控制器类返回 YES(shouldAutorotateToInterfaceOrientation 函数),我的问题解决了。

尝试这样做......也许你也会成功

于 2012-05-03T07:14:57.310 回答
0

我使用这种方法进行定位。它工作正常。

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
}

还有其他几种方法可以帮助您确定方向,例如:

• willRotateToInterfaceOrientation

• didRotateFromInterfaceOrientation

• willAnimateFirstHalfOfRotationToInterfaceOrientation

• willAnimateSecondHalfOfRotationFromInterfaceOrientation

于 2012-05-09T10:50:42.630 回答