2013-12-04 3 views
0

У меня есть MPMoviePlayerView, который я создаю программно. Моя автоматическая ротация PlayerView отлично работает с iOS 5, но она не работает в iOS 6 и iOS 7. Я пытался добавить определение ориентации, но проблема остается такой же.Проблема с автоматическим вращением

Может кто-нибудь сказать мне, как я могу поддержать автоповорот в прошивке 5, IOS 6 и 7. прошивки

Спасибо,

ответ

0

Try реализовать этот метод в AppDelegate:

-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window 
{ 

} 

вам может сделать условие для обоих режимов.

например, если медиаплеер в полном объеме затем

возвращение UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight; иначе возвращение UIInterfaceOrientationMaskPortrait;

благодаря

0
[[UIApplication sharedApplication] statusBarOrientation]; 
[[UIDevice currentDevice] orientation]; 
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; 
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceRotatedEventList:) name:UIDeviceOrientationDidChangeNotification object:nil]; 


-(void)deviceRotatedEventList:(NSNotification*)notification 
{ 

UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; 
if(orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) 
{ 



    //Do your stuff for landscap 
} 
else if(orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) 

    { 

    } 

} 

// Для метода вращения написать ур код potraite и ландшафтном режиме независимо ........

Смежные вопросы