约束控件在Xcode中显示为灰色(将工具栏固定到底部) [英] Constraint controls greyed out in Xcode (pinning toolbar to bottom)

查看:560
本文介绍了约束控件在Xcode中显示为灰色(将工具栏固定到底部)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工具栏,我想要固定到底部。我试图使用Storyboard而不是代码来执行此操作。

I have a toolbar that I want to pin to the bottom. I was trying to use Storyboard rather than code to do it.

当我从工具栏命令+拖动到控制器时,我得到的只是一个委托选项,而不是固定到每个选项的选项其他。

When I command + drag from the toolbar to the controller, all I get is a delegate option rather than the option to pin to each other.

如何添加约束以将此工具栏固定到视图控制器的底部?

How do I add constraints to pin this toolbar to the bottom of the view controller?

这是我更新的视图控制器流程。不确定我是否需要第二个导航控制器。

Here's my updated view controller flow. Not sure if I need the second navigation controller.

推荐答案

因此,您希望在同一窗口中显示表格视图和工具栏。在Xcode中设置它的方法是使用导航界面,因为它有一个工具栏。你可能不会做任何导航,但这并不重要。从导航界面开始,并将表视图控制器作为其子视图(其根视图控制器)。现在配置导航视图控制器,以便导航栏不显示,但工具栏是。

So it looks like you want a table view and a toolbar in the same window. The way to set that up in Xcode is to use a navigation interface, because it has a toolbar. You aren't going to be doing any navigating, perhaps, but that's not important. Start with a navigation interface, and have the table view controller as its child (its root view controller). Now configure the navigation view controller so that the navigation bar is not showing but the toolbar is.

(当然,如果你已经 in 导航界面,然后只显示其工具栏,你就在那里。)

(Of course, if you are already in a navigation interface, then just show its toolbar and you're there.)

不涉及任何约束。

这篇关于约束控件在Xcode中显示为灰色(将工具栏固定到底部)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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