AutoRotate ONLY MpMoviePlayerControler iOS 6

后端 未结 2 1725
名媛妹妹
名媛妹妹 2020-12-22 11:12

okay guys Same question as everyone else. I got it to work if i edited the .plist to support all orientation, but i only need to support rotation at my MPMoviePlayerControl

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-22 11:37

    Add following method in AppDelegate.h

    -(NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
    {
    
        if(!ISIPAD)){
    
            if ([[self.window.rootViewController presentedViewController] isKindOfClass:[MPMoviePlayerViewController class]] && ![[self.window.rootViewController presentedViewController] isBeingDismissed])
            {
                return UIInterfaceOrientationMaskAllButUpsideDown;
            }
            else
            {
                return UIInterfaceOrientationMaskPortrait;
            }
        }
        return UIInterfaceOrientationMaskAllButUpsideDown ;
    
    }
    

提交回复
热议问题