2010-12-19 144 views
0

在IOS 3.2中,我能夠像在橫向模式中一樣顯示我的UISplitViewController。IOS4 UISplitViewController在縱向方向上顯示如同橫向的RootViewController

在IOS 4.2中,RootViewController(MasterView)未在縱向模式中顯示。有誰知道我們是否需要在popover中顯示rootviewcontroll?我們可以像它在橫向模式中那樣並排顯示它嗎?

我想避免點擊一個按鈕顯示馬西德威(當在縱向模式下)

回答

0

在這種情況下,你可以跳過splitviewcontroller創造只能查看基本應用程序,你可以手動控制UI 。

-1
  1. 上viewDidAppear你可以做

    [splitViewController setHidesMasterViewInPortrait:NO];

即使您收到警告,它也能正常工作。我認爲你可以使用自定義的splitviewcontroller創建類別來擺脫警告。

2.Otherwise你可以做在viewWillAppear中像

,你可以這樣做

if (self.interfaceOrientation == UIInterfaceOrientationPortrait || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { 
    UIViewController *master = [[splitViewController.viewControllers objectAtIndex:0]; 
    UIViewController *detail = [[splitViewController.viewControllers objectAtIndex:1]; 
    [splitViewController setupPortraitMode:master detail:detail]; 

} 

(setupPortraitMode)http://intensedebate.com/profiles/fgrios

+2

看起來像setHidesMasterViewInPortrait是私有方法。請讓我知道如果是這樣的話? – UPT 2012-03-20 07:09:08

-1

我使用setHidesMasterViewInPortrait:NO,它在5.0以前的版本上工作,甚至進入了蘋果商店一次。但下一次我更新應用程序時,他們拒絕了它,因爲我使用了一個隱藏的API。我仍在尋找一種方法來完成這項工作。

相關問題