iOS-控制屏幕旋转

作者: 洲洲哥 | 来源:发表于2016-12-06 16:24 被阅读25次

    这个方法不推荐,因为有可能你到appstore上的时候很可能被拒掉。不是苹果公开的API.

    [[UIDevice currentDevice] setValue:@(UIDeviceOrientationLandscapeRight) forKey:@"orientation"];
    
     [[UIDevice currentDevice] setValue:@(UIDeviceOrientationPortrait) forKey:@"orientation"];
    

    这里的

    UIDeviceOrientationPortrait
    UIDeviceOrientationPortraitUpsideDown
    UIDeviceOrientationLandscapeLeft
    UIDeviceOrientationLandscapeRight
    UIDeviceOrientationFaceUp
    UIDeviceOrientationFaceDown
    

    各位看官自行调试咯
    如有问题可添加我的QQ:1290925041
    还可添加QQ群:234812704(洲洲哥学院)
    欢迎各位一块学习,提高逼格!
    也可以添加洲洲哥的微信公众号

    更多消息

    更多信iOS开发信息 请以关注洲洲哥 的微信公众号,不定期有干货推送:

    这里写图片描述

    相关文章

      网友评论

        本文标题:iOS-控制屏幕旋转

        本文链接:https://www.haomeiwen.com/subject/aiermttx.html