控制横屏竖屏


#import "AppDelegate.h"


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

    

    /**

     *  手机在播放视频的时候允许横屏显示

     */

    if ([NSStringFromClass([[[windowsubviews]lastObject]class]) isEqualToString:@"UITransitionView"]) {

        returnUIInterfaceOrientationMaskAll;

    }

    returnUIInterfaceOrientationMaskPortrait;

}


你可能感兴趣的:(iOS)