ios - 向所有 View 可见的 iOS 应用程序添加顶部栏

标签 ios objective-c uiview

在选项卡栏 iOS 应用程序中添加顶部栏( View )的最佳方法是什么,该顶部栏始终保留在所有 View 的顶部,无论选择哪个选项卡(如下图所示)?

enter image description here

最佳答案

我会使用 UIViewControllerContainment。看看

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

我设置它的方式是有一个 UIViewController,它有两个 ContainerView。一个 ContainerView 将在其中包含 UITabBarController,另一个将在顶部栏中包含 UIViewController。

这是我在 UIStoryboard 中所做的 enter image description here

关于ios - 向所有 View 可见的 iOS 应用程序添加顶部栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27553579/

相关文章:

IOS RoundView 使子 ImageView 变圆

ios - iPhone Jabber/XMPP 客户端... "TURN Connection failed"

ios - 禁用和启用状态的 UIButton tintColor?

objective-c - 将 CSV 中带引号的字符串转换为不带引号的 NSMutableArray

iphone - 如何从 iPhone 应用程序发送邮件?

ios - 将 AVPlayerViewController 嵌入到 UIView 中

swift - 如何防止一个 UIView 被另一个 UIView 隐藏?

ios - 字典 swift 4 中的保留容量是什么?

ios - 如何在具有现有值的 uilabel 上添加一个值并显示它?

ios - 正在加载 Apple Pay 送货地址 No Street