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 ...
随机推荐
- python之获取微信服务器的ip地址
# -*- coding: cp936 -*- #PYTHON 27 #xiaodeng #获取微信服务器的ip地址 import urllib url='https://api.weixin.qq. ...
- 3299 有序数组合并求第K大问题
题目描述 Description 给出两个有序数组A和B(从小到大有序),合并两个有序数组后新数组c也有序,询问c数组中第k大的数 假设不计入输入输出复杂度,你能否给出一个O(logN)的方法? 输入 ...
- sshd服务分析
00.阐述 sshd 服务 基本上,所有的 ssh 相关设定都放在 /etc/ssh/sshd_config 里面!不过,每个 Linux distribution 的预设设定都不太相同, 所以我们有 ...
- 在centos 5.5 i386 上安装 oracle 10g xe
1.安装rpm包 nano /v.sh 将下面内容复制进去 #!/bin/bash rpm -Uvh compat-db-4.2.52-5.1.i386.rpm rpm -Uvh compat-lib ...
- CSS特效(弧光效果)
代码很简单, 根据需要修改标签class和弧光效果的宽高位置就可以了. <!DOCTYPE html> <html lang="en"> <head& ...
- 虚拟机virtualbox中挂载新硬盘
在virtualbox中装好Ubuntu后,发现硬盘空间太小,怎样才能增加硬盘容量?那就是再建一个硬盘: 1. 添加新硬盘 设置 -> Storage -> SATA控制器->右击, ...
- 寻找自己的道路——与技术同胞共勉 一种划分为七个阶段的道路:自信=>意志=>布局=>切入点=>团队=>渠道=>产品
寻找自己的道路——与技术同胞共勉 每个人的幸福都是不一样的.我喜欢田园式的生活,在人多的地方总是不舒服. 对我来说,最幸福莫过于在工作中做着自己喜欢的事情.闲暇时,在能够眺望江边的地方,端着一杯红酒, ...
- 进阶之路(中级篇) - 018 基于arduino的简易版智能衣架
一. 设备及要求 目的:制作一个可以自动根据事实的天气的状况进行对衣架上的衣服进行晾晒. 基础装置:可伸缩的晾衣架. 开发环境:Arduino1. 8.1 主控板:Arduino UNO 动力装 ...
- linux c学习笔记----线程创建与终止
进程原语 线程原语 描述 fork pthread_create 创建新的控制流 exit pthread_exit 从现有的控制流中退出 waitpid pthread_join 从控制流中得到退出 ...
- Android上面通过URL来启动本地应用
<application android:allowBackup="true" android:icon="@drawable/ic_launcher" ...