ios - 将 UI 元素添加到 Xcode 创建的 NavigationController Storyboard 场景中

标签 ios xcode uinavigationcontroller storyboard

Storyboard似乎很有趣,但我发现它非常有限。

我想使用 iPhone/iPad 导航 Controller /DetailView Controller 的标准 Storyboard,但在 iPhone nab Controller 中我还想添加状态等控件。

所有编辑器似乎都允许嵌入到选项卡 View Controller 中。

例如,我如何调整导航 Controller 的大小并在下面添加按钮/标签/其他内容?

最佳答案

导航栏有一些限制,您可以在 Apple 的类引用中了解这些限制。我使用 Storyboard 在导航栏中添加更多信息的一种方法是向导航栏添加 UIBarButton。根据导航栏的大小,使用尺寸检查器将其增大到您想要的大小,然后在其中放置一个 UIView 并使其与 UIBarButton 一样大。然后,UIView 可以包含用于状态的 UILabels 和用于操作的 UIButtons。看起来像这样:

Screen Shot Of UIBarButton containing UIView which contains 2 UILabels and 1 UIButton

关于ios - 将 UI 元素添加到 Xcode 创建的 NavigationController Storyboard 场景中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8610209/

相关文章:

ios - openGLES iOS 中的 Unity 模型

ios - NSDateFormatter 中的 AM/PM 问题

ios - 为什么我不能在 Storyboard 中设置导航 Controller 的背景颜色?

ios - 如何构建需要 CocoaPods pod 的 Appcelerator Titanium iOS 模块

ios - 带有搜索图标的 UINavigationBar - 单击时推送模态搜索 View

ios - 导航 Controller 无法正常工作

ios - 展开函数 swift 3

ios - 如何在 CoreData 的 NSLog 中显示详细信息?建议我一个解决方案

ios - 归档在没有任何上下文的情况下停止,但在设备上构建时效果良好

ios - 导航 Controller 定制不对应