Constraint controls greyed out in Xcode (pinning t

2019-08-09 20:18发布

问题:

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.

回答1:

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.

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

No constraints are involved.



标签: xcode swift ios8