小编jmo*_*ont的帖子

系统忽略iPhone旋转

在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类型"

iphone events rotation uiapplication ios4

1
推荐指数
1
解决办法
1549
查看次数

标签 统计

events ×1

ios4 ×1

iphone ×1

rotation ×1

uiapplication ×1