将顶部栏添加到所有视图都可见的iOS应用程序 [英] Add a topbar to iOS application visible to all views

查看:88
本文介绍了将顶部栏添加到所有视图都可见的iOS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在标签栏iOS应用程序中添加顶部栏(视图)的最佳方法是什么,它总是保留在所有视图之上,而不管选择哪个标签如下图所示?

What is the best way to add a topbar(View) in a tabbar iOS application that always remain on top of all the views, irrespective of which tab is selected like the image below?

推荐答案

我会使用UIViewControllerContainment。看看

I would use UIViewControllerContainment. Take a look at

https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html

我的方式设置它有一个UIViewController有两个ContainerViews。一个ContainerView将包含UITabBarController,另一个将具有顶部栏的UIViewController。

The way I'd set it up is have a UIViewController that has two ContainerViews. One ContainerView will have the UITabBarController in it and the other would have the UIViewController for the top bar.

这是我在UIStoryboard中做的

Here is what I did in a UIStoryboard

这篇关于将顶部栏添加到所有视图都可见的iOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆