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 ...
随机推荐
- 一起talk C栗子吧(第八十五回:C语言实例--使用信号进行进程间通信二)
各位看官们,大家好,上一回中咱们说的是使用信号进行进程间通信的样例,这一回咱们接着上一回的内容,继续说该样例.闲话休提.言归正转. 让我们一起talk C栗子吧. 我们在上一回中举了使用信号进行进程间 ...
- fiddler怎么修改服务器返回参数并发送
在进行使用fiddler中提供了较多的功能进行使用的,那么进行就可以对当前的网页中的暂停之后,在进行使用fiddler中把拦截起的后,在进行修改的服务器参数的之后,在把参数修改完成之后,把进行发送出去 ...
- T-Sql常用语句
1.用bcp导出txt数据 DECLARE ), ) BEGIN , ), '/', '-'); SET @bcp = 'bcp WebStat.dbo.[PV_HIS_' + @date + '] ...
- Iphone开发基本UI组件
在IOS中的基础UI组件,IPHONE的组件大多以UI开头,这种独树一帜的命名方法极有可能是为了与其他系统的组件进行区分,避免混淆引起冲突: 下面描述一下IOS的基础UI控件以及和Android中的 ...
- oracle安装后sqlnet.ora文件
# sqlnet.ora Network Configuration File: D:\Develop\oracle11g\product\11.2.0\dbhome_1\network\admin\ ...
- java unicode转码为中文 实例
package com.infomorrow.parser_report; import org.junit.Test; public class Decode { @Test public void ...
- Cobbler自动部署主机系统
Cobbler自动部署主机系统 简介: Cobbler由python语言开发,是对PXE和 Kickstart以及DHCP的封装.融合很多特性,提供了CLI和Web的管理形式.更加方便的实行网络安装. ...
- 使用Anemometer分析MySQL慢查询记录
数据库管理员一般是用percona的toolkit工具来分析MySQL慢查询记录,但是不够直观. 下面介绍一款比较直观的工具来统计分析MySQL慢查询记录anemometer. 在使用之前需要安装pe ...
- MongoDB资料汇总专题
原文地址:http://bbs.chinaunix.net/thread-3675396-1-1.html 上一篇Redis资料汇总专题很受大家欢迎,这里将MongoDB的系列资料也进行了简单整理.希 ...
- Swift 基本运算符
前言 Swift 语言支持大部分标准 C 语言的运算符,并且改进了许多特性来使我们的代码更加规范,其中主要包含算数运算符.区间运算符.逻辑运算符.关系运算符.赋值运算符.自增自减运算符.溢出运算符等. ...