如何设置基于UISplitViewCOntroller的iPad应用程序的初始方向 [英] How can I set the Inital Orientation for a UISplitViewCOntroller-based iPad App

查看:115
本文介绍了如何设置基于UISplitViewCOntroller的iPad应用程序的初始方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个拆分视图应用程序在iPad上运行良好。它使用默认设置(纵向中的Popover,横向的左侧的表视图)。应用程序运行后,视图会正确移动。我看到的问题是,当应用程序启动(在模拟器中)以横向模式运行时,UI范例是用于Portrait模式(主列表是popover)是什么负载。



我认为这是一个陌生的模拟器,或者我缺少一个选项在我的主视图控制器。

解决方案

将此添加为答案,希望对那些需要相同修复的人更加明显。 / p>

我解决了这个问题。我在等待一个外部XML流被加载&解析。因此,我加载窗口与splitViewController视图后我的 applicationDidFinishLaunching 方法。



添加:

  [window addSubview:splitViewController.view]; 
[window makeKeyAndVisible];

回到该方法中修正方向识别


I have a split view app running fine on the iPad. It is using the default setup (Popover in Portrait, table view on the left in landscape). The views shift correctly once the app is running. The problem I am seeing is that when the app starts (in the simulator) running in landscape mode the UI paradigm is the one intended for Portrait mode (Master List is a popover) is what loads.

I am thinking this is some strangeness with the simulator, or I am missing an option on my main view controller.

解决方案

Adding this as an answer as well in the hopes it will be more apparent to those in need of the same fix.

I solved this. I was waiting for an external XML stream to be loaded & parsed. As a result I was loading the window with the splitViewController view AFTER my applicationDidFinishLaunching method.

Adding:

[window addSubview: splitViewController.view]; 
[window makeKeyAndVisible]; 

back into that method fixed the orientation recognition

这篇关于如何设置基于UISplitViewCOntroller的iPad应用程序的初始方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆