MPMoviePlayerController不会在iOS 5中以全屏模式更改方向 [英] MPMoviePlayerController does not change Orientation in full-Screen mode in iOS 5

查看:57
本文介绍了MPMoviePlayerController不会在iOS 5中以全屏模式更改方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我仅支持纵向模式,并且将UINavigationController用作RootViewController.但是,当我使用MPMoviePlayerController播放电影并且播放器"为全屏"时,我也希望它同时支持两种landscape模式.

In my app i support only portrait mode and use UINavigationController as RootViewController. But when i am playing movie using MPMoviePlayerController and Player is Fullscreen than i want it to support both landscape mode Also.

使用@ChrisBallinger

Does this using this great code by @ChrisBallinger this in iOS6 but its not working in iOS5 After long search on google i am not able to find the solution so posted here. Please help with this problem.

我还试图将navigationcontroller子类化,并将Rotate代码设置为在此处找到但没有运气.

I have also tried to subclassing the navigationcontroller and set the Rotate code it found here but no luck.

推荐答案

我的沙盒应用程序: https://github.com/comonitos/programatical_device_orientation

My sandbox app: https://github.com/comonitos/programatical_device_orientation

解决方案很简单:

在界面(h文件)中:

    BOOL rotated;

在实施中(M个文件): 1.重写

in implementation (m file): 1. rewrite

    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
    return rotated;
    }

2个电话[自我设置]

2 call [self setup]

    -(void) setup { 
    rotated = YES; 
    [[UIDevice currentDevice] setOrientation:UIDeviceOrientationLandscapeLeft]; 
    rotated = NO; 
    }

这篇关于MPMoviePlayerController不会在iOS 5中以全屏模式更改方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆