0

ナビゲーションコントローラーを押して横向きでビューを開こうとしていますが、常に縦向きで開きます。

最初のビューは縦向きで、ボタンをクリックすると次のビューは横向きになります。

次のコードを試しています

ビューの呼び出し:

ResultViewController *resultView = [[ResultViewController alloc] init];
    [[self navigationController] pushViewController:resultView animated:YES];

横向きで開くビュー:

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

ここで他に試すことはありますか?

ありがとう

4

1 に答える 1

0

試す..

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

その後...

- (void)viewDidLoad {
    [[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft animated:YES];

}

結果ビューで

于 2010-10-14T21:31:54.687 に答える