[英]Rotate Landscape to Portrait in MPMoviePlayerViewController in ios6 and ios7
In my project i press done button in video player then player dismiss but view stay in landscape mode. 在我的项目中,我在视频播放器中按完成按钮,然后播放器关闭,但视图保持在横向模式。 but i want all view in my apps in portrait .
但我希望我的应用程序中的所有视图都是纵向的。 Only video player move both side landscape or Portrait.
只有视频播放器可以移动侧面横向或纵向。
I try This link but this not work for me . 我试试这个链接,但这不适合我。 enter link description here
在此输入链接描述
1 : Rotate Portrait to Landscape in pdfreader in ios6 and ios7 1 : 在ios6和ios7中的pdfreader中将纵向旋转到横向
First one is player when landscape mode and second when i press done button in player. 第一个是景观模式时的玩家,第二个是我在播放器中按完成按钮时。 Please give me solution this problems.
请给我解决这个问题。
On the ViewController use this method it will automatically move the portaint mode 在ViewController上使用此方法,它将自动移动portaint模式
#import <objc/message.h>
-(void)viewDidAppear:(BOOL)animated{
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
objc_msgSend([UIDevice currentDevice], @selector(setOrientation:), UIInterfaceOrientationPortrait );
}
}
I found same difficulties like above you have mentioned. 我发现你提到的同样困难。 Im not seeing your code.
我没有看到你的代码。 may be you used Tab bar or general Navigation for presenting your video player.
可能是您使用Tab栏或一般导航来呈现您的视频播放器。 In that case refer these links http://www.disalvotech.com/blog/app-development/iphone/ios-6-rotation-solution/ , Making one specific class of view controller auto rotate in a tab bar app, but forcing all other classes of view controller to stay portrait
在这种情况下,请参考这些链接http://www.disalvotech.com/blog/app-development/iphone/ios-6-rotation-solution/ , 使一个特定类别的视图控制器在标签栏应用程序中自动旋转,但强制所有其他类的视图控制器保持肖像
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.