有选择地禁用UITabBarViewController管理的视图上的旋转

时间:2011-11-28 01:16:47

标签: ios uiview uitabbarcontroller rotation auto-rotation

在我的应用程序中,我有一个tabbarController和5个由它管理的视图控制器。

我只想让一个UIView旋转到横向,并在旋转到横向时使标签栏不可见。在目前的情况下,我的所有观点都会自我调整,这不是我所期望的。

我不希望它旋转的UIView代码是:

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation     duration:(NSTimeInterval)duration
{
    if (UIInterfaceOrientationLandscapeLeft) {
        // stop the rotation, keep it as portrait orientation
        // from app document, it says for UITabbarController, rootview which is   uitabbarcontroller and views managed by it should all agree on the same orientation otherwise they wont rotate.
        // how can i do this?
    }
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

0 个答案:

没有答案