0

こんにちはすべて私は、すべてのタブビューではなく最初のビューのみの横向きをサポートしたいタブバーアプリケーションを開発しています.1つのタブのみがすべての向きをサポートし、残りのタブは縦向きのみをサポートする必要があります. FirstView.m で

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

secondView.m で

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

どのタブビューでも横向きにすることはできません。前もって感謝します

4

2 に答える 2

0

インターフェイスを AND するのではなく、OR する必要があります。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
于 2012-10-10T07:47:16.663 に答える
0

(BOOL)shouldAutorotateToInterfaceOrientationiOS 5 のメソッドについて読む

于 2012-10-10T07:19:50.280 に答える