iPhone:防止旋转视图

时间:2010-05-12 13:12:30

标签: objective-c iphone rotation uitabbarcontroller

我使用带有4个视图的UITabBarController。这四个视图中的第一个应该能够旋转,其他三个视图不能旋转。现在的问题是,当有一个标签栏控制器时,你必须将所有使用过的视图设置为可旋转(即在shouldAutorotateToInterfaceOrientation中返回TRUE)。

所以,我现在的问题是,即使shouldAutorotateToInterfaceOrientation方法返回TRUE,我能否阻止三个视图轮换?

1 个答案:

答案 0 :(得分:1)

有点晚了,但也许有人可以通过在所有的shouldAutorotate ...方法中说出类似的东西来解决这个问题:

if (firstTabBarIsShowing) {
   return YES; //enable rotation if first tab bar is showing its content
} else {
   return NO; //if other views are showing, don't rotate anything
}

然后确保视图以第一个标签栏显示开始。也许这可能会欺骗它。

相关问题