0

メソッドを呼び出すときに、ビューを強制的に横向きにしたい。

メソッドが実行されると、次のように呼び出します。

[self shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)UIInterfaceOrientationLandscapeRight];

自動回転する方法

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}

問題は、ビューが回転を強制しないことです。シミュレーターでテストすることは可能ですか、それとも実際のデバイスで動作しますか?

4

1 に答える 1

1
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:YES];
于 2012-06-14T17:12:16.443 に答える