3

私はiPadのTabBarApplicationを持っています。TabbarControllerをサブクラス化して、アプリケーションが向きの変更に反応するようにしました。

@implementation frankenlandTabBarController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (
            interfaceOrientation == UIInterfaceOrientationPortrait || 
            interfaceOrientation == UIInterfaceOrientationLandscapeLeft || 
            interfaceOrientation == UIInterfaceOrientationLandscapeRight
            );
}


@end

問題は、タブバラップのすべてのビューコントローラーをこの向きにしたくないということです。

単一のコントローラーでメソッドを上書きしshouldAutorotateToInterfaceOrientationても効果はありません。

何か案は?

ありがとう!

4

1 に答える 1

3

tabBarの1つのビューの方向を変更することはできず、別のビューの方向を変更することはできません。TabBarを指定する場合は、すべてのサブビュー(タブ)の向きが同じである必要があります。各ViewControllerとTabBarControllerで方向を設定する必要があります。

于 2010-12-20T23:01:42.113 に答える