简体   繁体   English

在ios6和ios7中的MPMoviePlayerViewController中将Landscape转换为Portrait

[英]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.

相关问题 iOS6从横向到纵向打破布局 - iOS6 landscape to portrait breaks the layout 如何自动旋转仅第一视图和第二视图仅横向模式iOS6 - How to auto rotate first view only portrait and second view only landscape mode ios6 当ViewController在iOS6 / iOS7中锁定为人像时旋转视图 - Rotation for view when viewcontroller locked to portrait in ios6/ios7 当我在iOS7中的iPad中将视图从“纵向”旋转到“横向”或反之时,UITextfield应该不会调用ChangeRactersInRange - UITextfield shouldChangeCharactersInRange is not calling when i rotate the view from Portrait to Landscape or vice versa in iPad in iOS7 iOS7 viewController和MPMoviePlayerViewController旋转 - iOS7 viewController and MPMoviePlayerViewController Rotation 仅限风景的应用程序仍然在iOS7中自动镜像到肖像 - Landscape-only app still autorotates to portrait in iOS7 如何在iOS 6及更高版本中将单个视图从纵向旋转为横向? - How to rotate a single view from portrait to landscape in iOS 6 and above? 在iOS 8中的纵向锁定应用程序中将单个视图旋转为横向 - Rotate a single view to landscape in a portrait locked Application in iOS 8 iOS上的人像风景 - Portrait to Landscape on iOS 横向/纵向冲突-iOS - Landscape/Portrait conflict - iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM