2016-08-18 42 views
0

enter image description here enter image description here按鈕動作時,不動於中,側邊欄emmended

當我按一下按鈕,屏幕是不是改變了側邊欄嵌入另一個VC。我認爲這是一個問題涉及到第二個控制器給出的類名SWRevealView控制器。

任何人都可以幫我解決這個問題嗎?我的代碼是:

- (IBAction)check:(id)sender { 

    SWRevealViewController *vc= [self.storyboard instantiateViewControllerWithIdentifier:@"dash"]; 
    [self presentViewController:vc animated:YES completion:nil]; 

} 
+0

你檢查標識符嗎? vc在這裏沒有? – Sofeda

+0

是的,它不是無..當我點擊登錄按鈕,然後在SWRevealviewController的幫助下嵌入側欄的屏幕畫面不打開..刺激器只是打開和關閉 – Bansal

+0

你有導航控制器嗎? – Sofeda

回答

0

我嘗試了一個爲你的問題的示例。它顯示了揭示視圖控制器使用按鈕操作。

首先設置View Controller。然後設置Reveal View Controller。

Utilities->Click Identity Inspector->Go to Identity(It is below to Custom Class)->Give 'dash' in Storyboard ID 

首先截圖顯示視圖控制器和顯示視圖控制器

enter image description here

然後我在故事板ID在ViewController.m

設置 '衝刺'

enter image description here

現在

- (IBAction)check:(id)sender 
{ 
    SWRevealViewController *vc= [self.storyboard instantiateViewControllerWithIdentifier:@"dash"]; 
    [self presentViewController:vc animated:YES completion:nil]; 
} 
+0

這是push..but的情況下,但我使用模態邏輯移動到另一個屏幕..在這個導航控制器是沒有必要的 – Bansal

+0

首先請告訴我,我們可以給名稱類SWRevealVIewController? – Bansal

+0

name class是什麼意思? – user3182143