如何显示MPMoviePlayer的导航栏

时间:2012-12-10 12:22:27

标签: ios xcode navigation mpmovieplayercontroller

我有一部电影在点击按钮时全屏播放MPMovieplayerView控制器。但MPMoviePlayerViewController顶部不显示导航栏。如何在播放电影时使导航栏可见?

1 个答案:

答案 0 :(得分:0)

MPMoviePlayerViewcontroller是标准UIViewController,因此只需将其显示为UINavigationController

的rootViewController

而不是

[self presentViewController:myMoviePlayerViewController animated:YES completion:nil];

做的:

UINavigationController *movieNavController = [[UINavigationController alloc] initWithRootViewController:myMoviePlayerViewController];
[self presentViewController:movieNavController animated:YES completion:nil];