2012-12-26 112 views

回答

2

得到像Inferis /觀景臺的定製組件,並且編程執行遏制:

@interface YourViewController : IIViewDeckController 

@end 

實現:

@implementation YourViewController 

-(void)awakeFromNib 
{ 
    UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil]; 
    self.centerController = [storyboard instantiateViewControllerWithIdentifier:@"CenterViewController"]; 
    self.leftController = [storyboard instantiateViewControllerWithIdentifier:@"LeftViewController"]; 
} 

@end 
+0

那麼我該如何顯示此視圖? –

+0

有一個回購的例子,得到並研究它https://github.com/Inferis/ViewDeck –

+0

這個例子使用.xib文件,我知道如何使用xib。我想使用故事板 –

7

我們寫MMDrawerController來解決這個問題,但我還沒有有關在故事板使用它的思想(僅僅因爲故事板不適合大型團隊維護)。

https://github.com/mutualmobile/MMDrawerController

+1

絕對推薦這一款。我見過的「滑出」導航的最佳實現。 @KCHarwood感謝您的辛勤工作,夥計們;) –

+0

謝謝@DmitryZhukov! – kcharwood

+0

的確很酷!幾乎讓你想創建一個新的應用程序只是爲了使用它:) –

1

如果別人願意做同樣的事情。我一直在使用ECSlidingView成功。它已經完成了使用故事板。還有一個例子。

https://github.com/edgecase/ECSlidingViewController.git

編輯:

那麼實現這個ECSlidingViewController我看到導航緩慢,奇怪了。畢竟切換到IIViewDeckController。快速和容易,超級!