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 *',当从不同的 Objective-C 类型传递 'presentMoviePlayerViewControllerAnimated:' 的参数 1 时,预期的 'struct MPMoviePlayerViewController *'”