简体   繁体   English

ios标签栏导航

[英]ios Tab Bar Navigation

I am wondering if it is possible to have a view controller in an iOS app that has a tabbar @ the bottom with links to other view controllers but no tab for the current view itself? 我想知道是否有可能在iOS应用程序中使用视图控制器,该应用程序的标签栏@底部带有指向其他视图控制器的链接,但没有用于当前视图本身的选项卡?

Ideally what I would like to do is have a view controller A with a tab bar to views B and C. When navigating to page B or C you would see the B/C tab selected in the tab bar. 理想情况下,我想做的是使用一个带有用于查看B和C的选项卡栏的视图控制器A。导航到页面B或C时,您会看到在选项卡栏中选择了B / C选项卡。 When navigating back to controller A you would not see the tab bar, but once navigating back to view B/C it would show again. 导航回控制器A时,您不会看到选项卡栏,但是一旦导航回查看B / C,它将再次显示。

Not that should matter but I am using Xamarin for development. 没关系,但是我正在使用Xamarin进行开发。

You should be able to. 你应该能够。 You add a UITabBar to ViewA. 您将一个UITabBar添加到ViewA。 You can then add ViewB and ViewC as UITabBarItems to the UITabBar. 然后,您可以将ViewB和ViewC作为UITabBarItems添加到UITabBar。

You would need a button in ViewB and ViewC that leads back to View A to get back to it (since ViewA will not be listed in the tab bar). 您将需要在ViewB和ViewC中使用一个按钮,使其返回到View A才能返回到它(因为ViewA将不会在选项卡栏中列出)。

You can NOT use a UITabBarController for this. 您不能为此使用UITabBarController。 UITabBarController does not allow for customizing the UITabBar like this. UITabBarController不允许像这样自定义UITabBar。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM