系统忽略iPhone旋转

jmo*_*ont 1 iphone events rotation uiapplication ios4

在UIApplication中是否有像beginIgnoringInteractionEvents这样的函数忽略旋转而不是触摸?我需要我的应用程序不要只在MPMovePlayerViewController我出现的那个旋转.

谢谢

[UPDATE]

这是我的代码 -

MPMoviePlayerViewController *mpViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:videoURL]];
[mpViewController shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
[self presentMoviePlayerViewControllerAnimated:mpViewController];
[mpViewController release];
Run Code Online (Sandbox Code Playgroud)

我通过添加shouldAutorotateToInterfaceOrientation:和setStatusBarOrientation:方法来实现它.它适用于模拟器.但是,如果我在播放视频时旋转iPhone,状态栏也会旋转并保持纵向"卡住"状态.

我的问题的图像在http://i28.tinypic.com/357mrub.png

[更新2]

通过继承MPMoviePlayerViewController(并实现shouldAutorotate方法),程序将按原样旋转.只有视频无法播放,因为该行

[self presentMoviePlayerViewControllerAnimated:mpViewController];
Run Code Online (Sandbox Code Playgroud)

不接受我的子类.

"警告:不兼容的Objective-C类型'struct NoRotate*',预期'struct MPMoviePlayerViewController*'在传递'presentMoviePlayerViewControllerAnimated:'的参数1时从不同的Objective-C类型"

Mys*_*ral 6

在您提供的视图中,实现shouldAutoRotate方法并只返回"NO".这将导致手机忽略任何和所有方向更改.