博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
shouldAutoRotate Method Not Called in iOS6
阅读量:6584 次
发布时间:2019-06-24

本文共 924 字,大约阅读时间需要 3 分钟。

转自: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 ():

@implementation UINavigationController -(BOOL)shouldAutorotate { // your code } -(NSUInteger)supportedInterfaceOrientations { (...) } @end

转载地址:http://zrxno.baihongyu.com/

你可能感兴趣的文章
React是UI的未来吗?
查看>>
中国人社部:2018年15个省(区、市)调整最低工资标准
查看>>
手把手教你通过Thrift 访问ApsaraDB for HBase
查看>>
MacOS安装MySQL 报错
查看>>
Java知识点总结(反射-反射操作泛型)
查看>>
Vue+webpack+Element 兼容问题总结
查看>>
《软技能》读书笔记(下)
查看>>
textarea文域高度自适应
查看>>
go语言renderer包代码分析
查看>>
【Scala谜题】成员声明的位置
查看>>
git最最最最...常用命令
查看>>
复杂recyclerView封装库
查看>>
见微知著 —— Redis 字符串内部结构源码分析
查看>>
Command './js-ant' failed to execute
查看>>
阿里云NFS NAS数据保护实战
查看>>
Spring cloud配置客户端
查看>>
产品研发项目管理软件哪个好?
查看>>
【阿里云北京峰会】一图看懂机器学习PAI如何帮助企业应用智能化升级
查看>>
Android API中文文档(111) —— MailTo
查看>>
Linux 中如何卸载已安装的软件
查看>>