在UIApplication中是否有像beginIgnoringInteractionEvents这样的函数会忽略旋转而不是触摸?我需要我的应用程序不要在我出示的MPMovePlayerViewController
中旋转。系统忽略iPhone旋转
感谢
[更新]
这里是我的代码 -
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
[UPDATE 2]
通过继承MPMoviePlayerViewController(和实施shouldAutorotate方法)我的问题的
图像,程序转动,它应。只有视频不播放,因为该行
[self presentMoviePlayerViewControllerAnimated:mpViewController];
不接受我的子类。
“警告:不相容的Objective-C类型 '结构NoRotate *',预期 '结构MPMoviePlayerViewController *' 时传递参数1 'presentMoviePlayerViewControllerAnimated:' 从不同目标C型”
它终于成功了!谢谢 – jmont 2010-07-16 05:34:25