转自: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的更多相关文章

  1. iOS Objective-C对象模型及应用

    前言 原创文章,转载请注明出自唐巧的技术博客. 本文主要介绍Objective-C对象模型的实现细节,以及Objective-C语言对象模型中对isa swizzling和method swizzli ...

  2. cocos2d-x 3.1.1 学习笔记[21]cocos2d-x 创建过程

    文章出自于  http://blog.csdn.net/zhouyunxuan RootViewController.h #import <UIKit/UIKit.h> @interfac ...

  3. Iphone和iPad适配, 横竖屏

    竖屏情况下: [UIScreen mainScreen].bounds.size.width = 320 [UIScreen mainScreen].bounds.size.width = 568 横 ...

  4. IOS开发经验总结(二)

    本文转载至 http://dreamahui.iteye.com/blog/1878922 IOS开发总结 by mhmwadm (感谢mhmwadm) 2013/4/10 1 XCode快捷键 4  ...

  5. iOS端一次视频全屏需求的实现(转)

    对于一个带有视频播放功能的app产品来说,视频全屏是一个基本且重要的需求.虽然这个需求看起来很简单,但是在实现上,我们前后迭代了三套技术方案.这篇文章将介绍这三种实现方案中的利弊和坑点,以及实现过程中 ...

  6. 3.20 内存及效率的一些总结 3.21 设置竖屏 3.22 CCLOG与CCLog区别

    3.20 内存及效率的一些总结 3.21 设置竖屏 1.android AndroidManifest.xml文件中, screenOrientation="landscape" ...

  7. iOS6、7、8、9新特性汇总和适配说明

    iOS6新特性 一.关于内存警告 ios6中废除了viewDidUnload,viewWillUnload这两个系统回调,收到内存警告时在didReceiveMemoryWarning中进行相关的处理 ...

  8. iOS6的旋屏控制技巧

    在iOS5.1 和 之前的版本中, 我们通常利用 shouldAutorotateToInterfaceOrientation: 来单独控制某个UIViewController的旋屏方向支持,比如: ...

  9. IOS6屏幕旋转详解(自动旋转、手动旋转、兼容IOS6之前系统)

    转自 http://blog.csdn.net/zzfsuiye/article/details/8251060 概述: 在iOS6之前的版本中,通常使用 shouldAutorotateToInte ...

随机推荐

  1. lvalue & rvalue

    https://www.youtube.com/watch?v=UTUdhjzws5g 作者:知乎用户链接:https://www.zhihu.com/question/50652989/answer ...

  2. LeetCode 225 Implement Stack using Queues(用队列来实现栈)(*)

    翻译 用队列来实现栈的例如以下操作. push(x) -- 将元素x加入进栈 pop() -- 从栈顶移除元素 top() -- 返回栈顶元素 empty() -- 返回栈是否为空 注意: 你必须使用 ...

  3. 在xpage上怎么用jdbc去连接sql server呀

    你去http://www.openntf.org/Internal/home.nsf 下載以下對應版本最新控件 XPages Extension Library 這裏面已經包括OSGI功能 OSGI在 ...

  4. maven project创建填充项

    GroupID是项目组织唯一的标识符,实际对应JAVA的包的结构,是main目录里java的目录结构. ArtifactID就是项目的唯一的标识符,实际对应项目的名称,就是项目根目录的名称. 一般Gr ...

  5. Tomcat默认界面可导致版本信息泄露+管理后台爆破

    由于配置的Tomcat时,管理页面未进行删除或者权限角色配置,攻击者可以通过暴力猜解进入到管理后台,从而上传获取shell. Tomcat的默认工具manager配置,在很多的生产环境中由于基本用不到 ...

  6. C# 7 out variables, tuples & other new features

    C# 7 out variables, tuples & other new features C# 7 is available on new Visual Studio 2017 and ...

  7. Android短信管家视频播放器代码备份

    自己保留备份,增强记忆   这是video的类 public class VideoActivity extends Activity { /** * 解析网络页面 */ private WebVie ...

  8. libev ev_io_init学习

    #define ev_io_init(ev,cb,fd,events) / do { ev_init ((ev), (cb)); ev_io_set ((ev),(fd),(events)); } w ...

  9. 根据自身经验总结的一个IT时间管理

      2012-11-13 内容存档在evernote,笔记名"根据自身经验总结的一个IT时间管理"

  10. 【Windows】DOS的常用命令

    cmd[[{/c|/k}][/s][/q][/d][{/a|/u}][/t:fg][/e:{on|off}][/f:{on|off}][/v:{on|off}]string] 参数 /c 执行stri ...