1

通常、私のアプリケーションでは、レポート ビューを除くすべてのビューが縦長モードで表示されます。レポート ビューは、設定ビューでデバイスを横向きモードに回転させた場合にのみ表示されます。デバイスを再び縦向きモードにすると、レポート ビューが閉じられ、設定ビューが表示されます。

In report view 

> shouldAutorotateToInterfaceOrientation

return ((interfaceOrientation == UIInterfaceOrientationLandscapeRight)||( interfaceOrientation == UIInterfaceOrientationLandscapeLeft));



Here at settings view 

    shouldAutorotateToInterfaceOrientation


    if((interfaceOrientation == UIInterfaceOrientationLandscapeRight)||( interfaceOrientation == UIInterfaceOrientationLandscapeLeft))
     {  

     Report *report = [[Report alloc]initWithNibName:@"Report" bundle:[NSBundle mainBundle]]; 
     [self.navigationController pushViewController:report animated:YES];
     [report release];

     }
     return YES;
     }
4

1 に答える 1

1

ビューコントローラーを shouldRotate... ではなくwillRotateToInterfaceOrientation:duration:、回転に応答する場所である で作成してください。では、shouldAutorotateToInterfaceOrientation:その向きに回転できるようにしたい場合は YES を返すだけです。あなたの場合、すべての向き、または PortraitUpsideDown を除くすべての向きのいずれかが必要なようです。

では、willRotateToInterfaceOrientation:duration:必要に応じてビューコントローラーをプッシュまたはポップできます。

于 2011-01-27T20:23:52.960 に答える