shouldAutoRotate Method Not Called in iOS6
转自:http://stackoverflow.com/questions/13588325/shouldautorotate-method-not-called-in-ios6
参考1:http://stackoverflow.com/questions/21088956/supportedinterfaceorientations-not-called-with-ios-7
参考2:http://stackoverflow.com/questions/12775265/ios-6-shouldautorotate-is-not-being-called
If you have a Navigation Controller managing these views, the shouldAutorotate method won't be called. You would have to subclass UINavigationController and override methods shouldAutorotate andsupportedIntervalOrientations.
From the docs:
Now, iOS containers (such as UINavigationController) do not consult their children to determine whether they should autorotate
Edit-----
As mentioned below by Lomax, subclassing UINavigationController is discouraged by Apple. You should try a category instead (this SO question explains it well):
@implementation UINavigationController
-(BOOL)shouldAutorotate
{
// your code
}
-(NSUInteger)supportedInterfaceOrientations
{
(...)
}
@end
shouldAutoRotate Method Not Called in iOS6的更多相关文章
- iOS Objective-C对象模型及应用
前言 原创文章,转载请注明出自唐巧的技术博客. 本文主要介绍Objective-C对象模型的实现细节,以及Objective-C语言对象模型中对isa swizzling和method swizzli ...
- cocos2d-x 3.1.1 学习笔记[21]cocos2d-x 创建过程
文章出自于 http://blog.csdn.net/zhouyunxuan RootViewController.h #import <UIKit/UIKit.h> @interfac ...
- Iphone和iPad适配, 横竖屏
竖屏情况下: [UIScreen mainScreen].bounds.size.width = 320 [UIScreen mainScreen].bounds.size.width = 568 横 ...
- IOS开发经验总结(二)
本文转载至 http://dreamahui.iteye.com/blog/1878922 IOS开发总结 by mhmwadm (感谢mhmwadm) 2013/4/10 1 XCode快捷键 4 ...
- iOS端一次视频全屏需求的实现(转)
对于一个带有视频播放功能的app产品来说,视频全屏是一个基本且重要的需求.虽然这个需求看起来很简单,但是在实现上,我们前后迭代了三套技术方案.这篇文章将介绍这三种实现方案中的利弊和坑点,以及实现过程中 ...
- 3.20 内存及效率的一些总结 3.21 设置竖屏 3.22 CCLOG与CCLog区别
3.20 内存及效率的一些总结 3.21 设置竖屏 1.android AndroidManifest.xml文件中, screenOrientation="landscape" ...
- iOS6、7、8、9新特性汇总和适配说明
iOS6新特性 一.关于内存警告 ios6中废除了viewDidUnload,viewWillUnload这两个系统回调,收到内存警告时在didReceiveMemoryWarning中进行相关的处理 ...
- iOS6的旋屏控制技巧
在iOS5.1 和 之前的版本中, 我们通常利用 shouldAutorotateToInterfaceOrientation: 来单独控制某个UIViewController的旋屏方向支持,比如: ...
- IOS6屏幕旋转详解(自动旋转、手动旋转、兼容IOS6之前系统)
转自 http://blog.csdn.net/zzfsuiye/article/details/8251060 概述: 在iOS6之前的版本中,通常使用 shouldAutorotateToInte ...
随机推荐
- Lucene解析 - 基本概念
Elasticsearch 权威指南中文版 https://www.elastic.co/guide/cn/elasticsearch/guide/cn/index.html 对于跳跃表,我们看 ...
- 怎样解决WampServer #1405 - Access denied for user 'root'@'localhost' (using password: NO)
转载请注明出处:http://blog.csdn.net/xingjiarong/article/details/47903227 之前一直在用wampserver,然后环境配置也是正确的,可是过了一 ...
- java 数组声明方法
//数组 public class Test16{ public static void main(String args[]){ //声明一: int [] x; x = new int[3];// ...
- <c:url>标签相关知识点
<c:url>标签: value:指定路径!他会在路径前面自动添加项目名. <c:url value="/index.jsp"/>,他会输出/day14/i ...
- 设置char变量指定位为0或1
int GetBit(char c,int i)//取c的第i位 { ; } void SetBit(char & c,int i, int v)//设置c的第i位为v,v是0或1 { if( ...
- 基于Jmeter跟Jenkins的自动化性能测试的一站式解决方案(转)
www.MyException.Cn 网友分享于:2015-08-26 浏览:0次 基于Jmeter和Jenkins的自动化性能测试的一站式解决方案 作者: Yu, Qingguo Shen, ...
- c++ remove_if
#include <algorithm> 函数remove_if()移除序列[start, end)中所有应用于谓词p返回true的元素. 此函数返回一个指向被修剪的序列的最后一个元素迭代 ...
- Eclipse中10个最有用的快捷键组合(转)
Eclipse中10个最有用的快捷键组合 一个Eclipse骨灰级开发者总结了他认为最有用但又不太为人所知的快捷键组合.通过这些组合可以更加容易的浏览源代码,使得整体的开发效率和质量得到提升. ...
- 遇到影响服务器性能的cpuspeed 服务
最近碰到一个很蛋痛的问题,,我在公司的代码上实现了一个功能,然后基于这个测试,结果比对数据发现每天少三千多万条,, 然后我各种优化,各种零碎部功能阉割,,还是丢数据! 之后,监控运行网卡----wat ...
- Java 时间相比较
private String getRunTime() { String start = new Date.getTime(); String end= new Date.getTime(); lon ...