Выборочное отключение поворота для представлений, управляемых UITabBarViewController - PullRequest
2 голосов
/ 28 ноября 2011

В моем приложении у меня есть 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);
}
...