storyboard - 关于 iOS7 Universal App 的问题

 骆树真次_902 发布于 2022-10-31 23:42
  1. story board 怎么设计?因为兼容 iOS7,所以无法使用 size class
  2. 如何在所有 view controller 允许 iPad 旋转,同时不允许 iPhone 不旋转
2 个回答
  • 问题一可不可以主做ios7然后向后兼容ios8

    2022-10-31 23:43 回答
  • 问题2的答案有了

    @interface UIViewController (Rotate)
    @end
    @implementation UIViewController (Rotate)
    - (NSUInteger)supportedInterfaceOrientations {
        if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
            return UIInterfaceOrientationMaskAll;
        return UIInterfaceOrientationMaskPortrait;
    }
    @end
    

    这个答案是兼容 iOS7 的做法。在 iOS8 and above 中,旋转这个含义已经没有意义了。

    2022-10-31 23:43 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有