缺少用于添加自动布局约束的 Xcode 引脚菜单
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26665399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode pin menu for adding Auto Layout constraints is missing
提问by David
In other projects, the menu is not missing. However, in one project I cannot see or find the menu. Does anyone know how to make it reappear? I could not find here or via Google or in the Apple docs, but perhaps I am not looking in the right place. I am using v6.1, if that matters.
在其他项目中,菜单不会丢失。但是,在一个项目中,我看不到或找不到菜单。有谁知道怎么让它重新出现?我无法在这里或通过 Google 或 Apple 文档找到,但也许我没有找对地方。如果这很重要,我正在使用 v6.1。
Many thanks!
非常感谢!
回答by Cristian Pena
Select the Storyboard file in the navigator, open the utilities menu on the top right, show the file inspector (the left icon) and under the Interface Builder Document menu, click Use Auto Layout.
在导航器中选择 Storyboard 文件,打开右上角的实用程序菜单,显示文件检查器(左侧图标),然后在 Interface Builder Document 菜单下,单击 Use Auto Layout。
Regards
问候
回答by MrDekk
At the bottom-right corner of canvas view there are some icons, one of them is the new pin menu. Use it
在画布视图的右下角有一些图标,其中之一是新的图钉菜单。用它
回答by user3741598
In case anyone has this problem: the one piece of information is missing from the otherwise correct answers - these icons are in the lower RIGHT corner. As such, if you don't have your storyboard view wide enough you won't get them - you have to increase the size of the view then you will see them.
如果有人遇到此问题:否则正确的答案中缺少一条信息 - 这些图标位于右下角。因此,如果您的故事板视图不够宽,您将无法获得它们 - 您必须增加视图的大小,然后才能看到它们。
回答by Naishta
Verified in Xcode 8.3 Swift 3 There is a possibility that Autolayout was disabled while creating the project. Select Main.storyboard, In the right menu that has "File Inspector", under the section 'Interface Builder Document', enable 'Use Auto Layout'. The pin menu comes up at the usual place - bottom right corner
在 Xcode 8.3 Swift 3 中验证 有可能在创建项目时禁用了自动布局。选择 Main.storyboard,在具有“文件检查器”的右侧菜单中,在“界面生成器文档”部分下,启用“使用自动布局”。图钉菜单出现在通常的位置 - 右下角
回答by Azzam Rar
First select the LaunchScreen.storyboard:
首先选择 LaunchScreen.storyboard:
Second select the parents view:
二选择父视图:
Third go to the file inspector:
第三步到文件检查器:
Fourth chick the use auto layout:
第四个小鸡使用自动布局: