2016-01-18 18 views
1

我有兩個故事板:Segue公司到另一個情節串連圖板,但導航控制器仍是可見的

  1. 登錄/註冊目的(沒有導航視圖控制器)
  2. 主要故事板(與導航視圖控制器)

當我點擊主故事板上的註銷按鈕(導航欄項目)時,我被重定向到登錄故事板,但仍然可以看到導航欄。 我該怎麼做segue也離開導航視圖控制器,以便導航欄將不可見?

+3

segue有哪些類型? –

+0

如果可能,請發佈故事板的截圖。 –

回答

0

在這裏你可以做什麼的對象,

當你想要顯示無導航欄的登錄控制器,請使用

 UIStoryboard * board = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 
     LoginCntrl * cntrl = [board instantiateViewControllerWithIdentifier:@"LoginCntrl"]; 
     [self presentViewController:LoginCntrl animated:YES completion:^{ 

    }]; 

這裏的instantiateViewControllerWithIdentifier方法中的'LoginCntrl'是故事板中指定的LoginCntrl的標識符。 因爲presentViewController不是導航控制器的一部分,所以不會在頂部顯示導航欄。

0

在註銷事件,改變窗口的RootViewController的,

1)創建的appDelegate 2的對象)創建LoginVC

appDelegateObject.window?.rootViewController = objectOfLoginViewController; 
相關問題