这2个UIViewController的属性,都和旋转相关,

当设备发生旋转时,首先会查看根controller的shouldAutorotate是否允许旋转,如果允许,再通过

supportedInterfaceOrientations返回的方向 和 系统支持的方向 的交集,判断当前这个旋转是否应该发生。

系统支持的方向可以通过2个方法确定,一个是通过info.plist

第二种是通过

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window

方法,第二种这种方法的优先级高,如果有同时设置,以第二种为准。

iOS 中的屏幕旋转shouldAutorotate和supportedInterfaceOrientations的先后关系的更多相关文章

  1. 【转】如何在 Android 程序中禁止屏幕旋转和重启Activity

    原文网址:http://www.cnblogs.com/bluestorm/p/3665890.html 禁止屏幕随手机旋转变化 有时候我们希望让一个程序的界面始终保持在一个方向,不随手机方向旋转而变 ...

  2. 如何在 Android 程序中禁止屏幕旋转和重启Activity

    禁止屏幕随手机旋转变化 有时候我们希望让一个程序的界面始终保持在一个方向,不随手机方向旋转而变化:在AndroidManifest.xml的每一个需要禁止转向的Activity配置中加入android ...

  3. iOS 设置随意屏幕旋转

    方法一,通过控制器继承或分类实现: 在UITabBarController 的子类或分类中实现 - (BOOL)shouldAutorotate { return [self.selectedView ...

  4. 谈谈iOS中的屏幕方向

    众所周知,iOS中提供了[UIDevice currentDevice].orientation与[UIApplication sharedApplication].statusBarOrientat ...

  5. ios 单个ViewController屏幕旋转

    如果需要旋转的ViewController 使用了UINavigationController,对UINavigationController进行如下扩展 @implementation UINavi ...

  6. 处理iOS设备的屏幕旋转

    某些情况下,不强制的给用户唯一的屏幕角度给用户.这样用户可以旋转手机得到不同的视觉体验. 最简单的就是safari,横看竖看都可以. 这时需要捕捉用户的屏幕旋转事件并处理.很简单,才两步.比把大象装冰 ...

  7. ios 不支持屏幕旋转

    - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; }

  8. IOS中获取屏幕尺寸

    //app尺寸,去掉状态栏 CGRect appRect = [UIScreen mainScreen].applicationFrame; NSLog(@"%f, %f, %f,%f&qu ...

  9. iOS开发——检测屏幕旋转

    步骤一.注册通知 1: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarOrien ...

随机推荐

  1. 家庭记账本小程序之框架设计(java web基础版一)

    1.设计主页 main.jsp <%@ page language="java" contentType="text/html; charset=UTF-8&quo ...

  2. css高級技巧

    1.鼠標顯示 a:小手cursor:pointer b:默認cursor:default c:勾選文本cursor:text d:拖動cursor:move 2.css三種佈局模型 a.流動模型(默認 ...

  3. Python——Django-urls.py的作用

    一.urls.py的作用是保存路径和函数的对应关系 二.函数返回指定内容 from django.urls import path #引用HTTP协议的代码 from django.shortcuts ...

  4. Lodop简答问答大全

    其他相关简短问答:Lodop简短问答客户反馈篇 及排查步骤 及注册相关,Lodop某个电脑打印内容大小有问题,LODOP超文本简短问答和相关内容,LODOP.C-Lodop简短排查语句.Lodop.c ...

  5. python基础3 字符串常用方法

    一. 基础数据类型 总览 int:用于计算,计数,运算等. 1,2,3,100...... str:'这些内容[]'    用户少量数据的存储,便于操作. bool: True, False,两种状态 ...

  6. Zabbix配置邮件监控

    zabbix服务端配置 安装软件并配置 使用第三方邮件实现报警 1. 安装软件 $ yum -y install mailx 2. 配置发送邮件账号密码和服务器 $ vim /etc/mail.rc ...

  7. django restframework permission

    与 authentication 和 throttling 一起,permission 决定是应该接受还是拒绝访问请求.权限检查总是在视图的最开始处运行,在任何其他代码被允许进行之前.权限检查通常会使 ...

  8. request对象的方法及其参数的传递

    先设计一个简单的登录界面index.htm: <html><head><title>request的使用</title></head>< ...

  9. (BFS) leetcode 279. Perfect Squares

    Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 1 ...

  10. (二分查找 结构体) leetcode33. Search in Rotated Sorted Array

    Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e. ...