ios 切换横竖屏

    xiaoxiao2026-05-21  5

    if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { SEL selector = NSSelectorFromString(@"setOrientation:"); NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]]; [invocation setSelector:selector]; [invocation setTarget:[UIDevice currentDevice]]; int val = UIInterfaceOrientationPortrait; [invocation setArgument:&val atIndex:2]; [invocation invoke]; }

    这个是  强制  竖屏的  代码!

    转载请注明原文地址: https://ju.6miu.com/read-1309898.html
    最新回复(0)