在我的项目中,不在更多部分下的选项卡正确响应方向,但更多部分下的选项卡没有响应。 例如,如果我在更多部分下有两个选项卡名称tab1和tab2,并且如果我在每个选项卡的“shouldAutorotateToInterfaceOrientation”方法中设置断点。之后如果我从更多部分选择tab1并尝试旋转它但是tab2的“shouldAutorotateToInterfaceOrientation”被调用。我选择的选项卡的delagate方法没有被调用。我正在使用XCode Ver 4.3.2。 有人可以帮我解决这个问题..
提前致谢, Prajnaranjan Das
答案 0 :(得分:1)
请写下标签栏控制器的所有根视图控制器的以下代码。
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return yes;
}
答案 1 :(得分:1)
我面对现在面临的同样的问题......
我返回YES(shouldAutorotateToInterfaceOrientation函数)到tababarcontroller里面的所有视图Controller类,我的问题解决了。
尝试这样做......也许你也会获得成功
答案 2 :(得分:0)
我用这种方法进行定位。它工作正常。
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
}
还有其他一些方法可以帮助您进行定位,例如:
•willRotateToInterfaceOrientation
•didRotateFromInterfaceOrientation
•willAnimateFirstHalfOfRotationToInterfaceOrientation
•willAnimateSecondHalfOfRotationFromInterfaceOrientation