組合標簽欄控制器和導航控制器

[英]Combining tab bar controllers and nav controllers


I'm just learning how tab bar controllers and nav controllers work together. I have the following storyboard but I've also experimented with nav controllers too but can't seem to make things work how I want:

我只是學習標簽欄控制器和導航控制器如何協同工作。我有以下故事板,但我也嘗試過導航控制器,但似乎無法使我的工作方式如何:

enter image description here

I have added a segue between the table cell and the "detail view" view controller. However, the transition isn't what I want as it slides up from the bottom. I would like it to slide from right to left. I select "push" but it still slides from the bottom.

我在表格單元格和“詳細視圖”視圖控制器之間添加了一個segue。然而,從底部向上滑動,過渡不是我想要的。我希望它從右向左滑動。我選擇“推”但它仍然從底部滑動。

In addition, I would like the table view to have the tab bar (which it does) but I don't want the "detail view" to have a tab bar (or nav bar and status bar).

另外,我希望表視圖有標簽欄(它可以),但我不希望“詳細視圖”有標簽欄(或導航欄和狀態欄)。

1 个解决方案

#1


2  

Your architecture would be like :

你的架構就像:

TabBarController - NavigationController -TableViewController - DetailViewController

TabBarController - NavigationController -TableViewController - DetailViewController

For hiding bottom tabbar on detail just set hidesBottomBarOnPush = true on the instance of DetailViewController.Currently your DetailViewController is not pushing because there is no NavigationController to add them up in stack as you want.

為了隱藏詳細信息的底部tabbar,只需在DetailViewController的實例上設置hidesBottomBarOnPush = true。當前你的DetailViewController沒有推送,因為沒有NavigationController可以根據需要將它們添加到堆棧中。

self.navigationController?.isNavigationBarHidden = true
UIApplication.shared.isStatusBarHidden = true

For hiding particulars as you queried.

用於隱藏您查詢的詳細信息。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2017/04/19/5a1bfe630ba488d121d53a0e47c53fc8.html



 
  © 2014-2022 ITdaan.com 联系我们: