タッチの代わりに回転を無視するUIApplicationのbeginIgnoringInteractionEventsのような関数はありますか?私がMPMovePlayerViewController
提示したものだけでアプリが回転しないようにする必要があります。
ありがとう
[アップデート]
これが私のコードです-
MPMoviePlayerViewController *mpViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:videoURL]];
[mpViewController shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
[self presentMoviePlayerViewControllerAnimated:mpViewController];
[mpViewController release];
shouldAutorotateToInterfaceOrientation:メソッドとsetStatusBarOrientation:メソッドの両方を追加することで機能しました。シミュレーターで動作します。ただし、ビデオの再生中にiPhoneを回転させると、ステータスバーも回転し、縦向きのままになります。
http://i28.tinypic.com/357mrub.pngでの私の問題の画像
[更新2]
MPMoviePlayerViewControllerをサブクラス化する(そしてshouldAutorotateメソッドを実装する)ことにより、プログラムは適切に回転します。回線が原因でビデオのみが再生されない
[self presentMoviePlayerViewControllerAnimated:mpViewController];
私のサブクラスを受け入れません。
「警告:互換性のないObjective-Cタイプ'struct NoRotate *'、予期される'struct MPMoviePlayerViewController*'の引数1の'presentMoviePlayerViewControllerAnimated:'を個別のObjective-Cタイプから渡す場合 "