簡體   English   中英

TabBarController上NavigationBar中的AddButton並從ViewControllers調用Segue

[英]AddButton in NavigationBar on TabBarController and call Segue from ViewControllers

我有一個帶有兩個ViewController的TabBarController。 其中之一具有TableView。 我想在ViewController的NavigationBar中設置TableView一個BarButtonItem(添加),以便僅當TableView在前面時才顯示BarButtonItem。 但這是行不通的。 我從沒見過BarButtonItem。 所以我把它放在TabBarController上,我看到了,但是在兩個ViewController中。 那不是我想要的。 我無法調用segue,從ViewController(TableView)到DetailViewController,因為我的TabBarController不知道。

正確的解決方案是什么? 我怎樣才能將一個BarButtonItem放在一個TabController客戶端的ViewController的NavigationBar上呢?

謝謝PS:我迅速編碼;-)

我張貼了我的實際情節提要的圖片,因此您可以更好地了解我。

“情節提要的圖片”

當我將添加按鈕放置在第一個位置時,無法在表格視圖的數據中調用新項的序列號。

當我將添加按鈕放置在第二個位置時,我可以調用segue,但是我從來沒有看到單擊它的按鈕。

單擊圖片左側表格視圖中某個單元格的詳細信息時,我的tabbarcontroller就會顯示。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM