2013-04-22 72 views
0

我試圖在我的應用程序中實現一個類似Facebook的菜單,並且我找到了JASidePanels使用/理解JASidePanels控件時遇到問題

按照GitHub頁面上的說明進行操作,並按預期工作。我無法理解的是,當用戶點擊LeftViewController的一個單元時(假設,當然,LeftViewController中有一個UITableView),CenterViewController將如何改變。

任何人都可以解釋這是怎麼發生的?

回答

1

的變化發生在這裏:

- (void)_changeCenterPanelTapped:(id)sender { 
    self.sidePanelController.centerPanel = [[UINavigationController alloc] initWithRootViewController:[[JACenterViewController alloc] init]]; 
} 

因此,在你UITableViewDelegate,當:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath; 

被調用時,你需要這樣來處理它:

self.sidePanelController.centerPanel = ...; 
+0

我m asuming'...'應該是我想要顯示的ViewController? – 2013-04-24 21:40:23

+0

是的,奧斯卡,確切地說。 – Peres 2013-04-25 05:59:10