Push UIViewController with different orientation to previous
转自:http://stackoverflow.com/questions/6695837/push-uiviewcontroller-with-different-orientation-to-previous
参考:http://stackoverflow.com/questions/15947349/how-to-handle-different-orientations-in-ios/16022631#16022631
It makes no sense to use a UINavigationController push transition to present a view in a different orientation. Which way round would the navigation bar / toolbar be?
Presenting a modal view controller is the right way to go about this. If this causes the status bar to become hidden, make sure yourModalViewController.wantsFullScreenLayout is NO.
Using -[UIDevice setOrientation:] is a private API, and will get your application rejected. See this question. What you ask is not possible using public API and is also not recommended from HIG standpoint. What is supported and you should implement, is modal presentation of the different view controllers with different supported interface orientation. This is why the default implementation of UINavigationController is to always rotate; it assumes all view controllers have the same supported interface orientations. Take for example video playback on iPhone. Open the video apps (that comes with iOS). The root view controller only supports portrait orientation. However, start a video, and a modal view controller pops up which only supports landscape interface orientations. This seems exactly the behavior you wish to achieve. This is why preferredInterfaceOrientationForPresentation is not called. preferredInterfaceOrientationForPresentation only gets called when using presentViewController:animated:. A small gotcha, if you require a navigation bar in each stage of your scene, you will need to enclose each modal view controller with a navigation controller. You can then pass the required data in prepareForSegue: by accessing topViewController of the navigation controller object in the segue. Here is an example project which behaves correctly according to your requirements (or at least will give you ideas how to implement): http://www.mediafire.com/?zw3qesn8w4v66hy
Push UIViewController with different orientation to previous的更多相关文章
- iOS屏幕旋转 浅析
一.两种orientation 了解屏幕旋转首先需要区分两种orientation 1.device orientation 设备的物理方向,由类型UIDeviceOrientation表示,当前设备 ...
- GeSHi Documentation
GeSHi Documentation Version 1.0.8.11 Authors: © 2004 - 2007 Nigel McNie © 2007 - 2012 Benny Baumann ...
- Tracing SQL Queries in Real Time for MySQL Databases using WinDbg and Basic Assembler Knowledge
https://www.codeproject.com/Articles/43305/Tracing-SQL-Queries-in-Real-Time-for-MySQL-Databas As ...
- MXNet源码分析 | KVStore进程间通信
本文主要基于MXNet1.6.0版本进行分析. 在上一篇文章中,我们分析了MXNet中KVStore的进程内通信机制.在这篇文章中,我们主要分析KVStore如何进行多节点分布式通信. 在KVStor ...
- UIViewController push或presentViewController 弹出方式
//导航控制器数量 add xjz 判断是push还是present出来的 NSArray *viewcontrollers = self.navigationController.viewContr ...
- ios swift 判断uiviewcontroller时push present 进来的 还是pop进来的
override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) //显示navbar self.navi ...
- IOS - Create Push Segue Animation Without UINavigationController
APPLE提供了三种storyboard segue的方式:push,modal,custom . push segue是系统预定义的跳转方式, 为了使其能正常工作,我们还必须加载UINavigati ...
- UIViewController所有API的学习。
<欢迎大家加入iOS开发学习交流群:QQ529560119> /* UIViewController is a generic controller base class tha ...
- Mobile Push Notification
In one embodiment, a method includes sending to a mobile client computing device a first notificatio ...
随机推荐
- SpringCloud stream连接RabbitMQ收发信息
百度上查的大部分都是一些很简单的单消费者或者单生产者的例子,并且多是同一个服务器的配置,本文的例子为多服务器配置下的消费生产和消费者配置. 参考资料:https://docs.spring.io/sp ...
- jQuery操作radio、checkbox、select总结
1.radio:单选框 HTML代码: <input type="radio" name="radio" id="radio1" va ...
- linux下编译upx 3.93
昨天,UPX发布了3.93版本. UPX(the Ultimate Packer for eXecutables)是一个非常全面的可执行文件压缩软件,支持dos/exe.dos/com.dos/sys ...
- Centos6.5卸载图形化
问题描述: Centos6.5想运行在非图形化状态,减小系统资源的开销!提升服务器性能....... 问题解决: 01.切换运行模式,变相实现非图形化运行 多用户模式 init 图形化模式 init ...
- 转:折腾一晚上Bullet及Ogre相关工具的成果 -- 3Ds Max,Maya, blender, GameKit
起始目的很简单,整合Bullet及Ogre,找个能够生成.scene和.bullet文件的建模工具. 折腾一晚上Bullet及Ogre相关的东西,基本上就像爱迪生发明灯泡一样,得出了N个失败的教训,总 ...
- redis统计大key
–bigkeys redis-cli -h <host> -p <port> -n <db> --bigkeys 这条命令会从指定的 Redis DB 中持续采样, ...
- Hopfield神经网络和TSP问题
一.TSP问题 旅行商问题,又叫货郎担问题.它是指如下问题:在完全图中寻找一条最短的哈密尔顿回路. 哈密尔顿回路问题:给定一个图,判断图中是否存在哈密尔顿回路. 哈密尔顿回路:寻找一条回路,经过图中所 ...
- React(0.13) 服务端渲染的两个函数
1.React.renderToString 函数, 参数是组件,返回一个字符串 <!DOCTYPE html> <html> <head> <title& ...
- Windows10内置Linux子系统
WSL 前言 前段时间,机子上的win10又偷偷摸摸升级到了一周年正式版,比较无奈.不过之前听闻这个版本已经支持内置的linux子系统,于是就怀着好奇心试玩了一把.虽然期间遇到了很多问题,但总体来 ...
- 关于varchar(max), nvarchar(max)和varbinary(max)
在MS SQL2005及以上的版本中,加入大值数据类型(varchar(max).nvarchar(max).varbinary(max) ).大值数据类型最多可以存储2^30-1个字节的数据.这几个 ...