转自: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. 解决BeautifulSoup库运行时报错问题

    解决BeautifulSoup库运行时报错问题 运行BeautifulSoup库时可能出现下面的错误,具体错误消息为:To get rid of this warning, change this: ...

  2. 使用CodePush实时更新 React Native 和 Cordova 应用

    近期公司的React native App(云订货)用上CodePush实时更新App技术了.棒棒的 CodePush 是微软开发的.能够实时更新 React Native 和 Cordova 应用. ...

  3. Easyui实用视频教程系列---Tree点击打开tab页面

    Easyui实用视频教程系列---Tree点击打开tab页面 首先 我们 要搭建环境 easyui 环境 然后 把tree 给创建出来 在某个位置 粘贴 下面代码 <ul id="tt ...

  4. iOS手势的综合运用

    //自定义一个VIEW封装手势功能 // CustormView.m // gesterDemoo // // Created by ganchaobo on 13-7-13. // Copyrigh ...

  5. HDUOJ-----Robot Motion

    Robot Motion Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tota ...

  6. IOCP笔记

    IOCP是win32下的异步IO,利用线程池来异步处理IO请求. 这里要分析一下异步调用,跟同步调用不同,异步调用 调用了就马上返回,但是还留下个话:有事情了马上通知我,我会处理滴.恩恩,这很符合我的 ...

  7. 【LeetCode】235. Lowest Common Ancestor of a Binary Search Tree (2 solutions)

    Lowest Common Ancestor of a Binary Search Tree Given a binary search tree (BST), find the lowest com ...

  8. zabbix邮件告警之 通过shell脚本发送告警

    说明:本文讲如何通过shell脚本实现zabbix发送告警邮件,共有5步1.设置mailx账号:是配置mailx的发信账号2.zabbix服务器端编写邮件发送脚本:是增加zabbix的告警方式,增加通 ...

  9. 深入学习 Git 工作流

    原文  https://github.com/xirong/my-git/blob/master/git-workflow-tutorial.md   个人在学习git工作流的过程中,从原有的 SVN ...

  10. linux达人养成计划学习笔记(四)—— 压缩命令

    一.常见的压缩格式: 二..zip格式压缩 1.压缩文件.文件夹 zip 压缩后文件名(.zip结尾) 压缩文件名zip -r 压缩后文件夹(.zip结尾) 压缩文件 2.解压缩 unzip 压缩文件 ...