2012-02-07 6 views
0

私は風景のみをサポートしようとしています。このダイアログボックスを表示するには、アプリケーションに関するいくつかのことを初めて説明する新しい要件があります。だから、のviewDidLoadで、発売します私の最初のビューコントローラでは、私はこのコードを持っている:次にFirstUseViewControllerで、私はこの定義したModalViewControllerを表示すると起動時に私のアプリの向きが変わります

BOOL showFirstTimeUse = [[NSUserDefaults standardUserDefaults] boolForKey:@"ShowFirstTimeUse"]; 
if (!showFirstTimeUse) { 
    FirstUseViewController *tvc = [[FirstUseViewController alloc] initWithNibName:@"FirstUseViewController" bundle:nil]; 
    tvc.modalPresentationStyle = UIModalPresentationFormSheet; 
    tvc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; 
    [self presentModalViewController:tvc animated:YES]; 
    [tvc release]; 
} 

:IBで

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight; 
} 

を、私はいずれも変更されていませんデフォルト設定の私は基本的にちょうどUIWebViewを画面の左上にドロップしてデータを表示し、コンセントを接続して書式付きのテキストを簡単に表示できるようにしました。

私は今、私のアプリケーションを実行すると、このビューコントローラのプレゼンテーションは、私のアプリが風景ではなくポートレートで起動するようになります。これをどうやって解決するのですか?ありがとう。

答えて

0

shouldAutorotateToInterfaceOrientation:の実装には問題があります。常に真実と評価されます。あなたはおそらく使用したいと思う:

return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
関連する問題