ios 如何删除已在 Xcode 故事板中设置的约束
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25945645/
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
How to remove a constraint that is already set in Xcode storyboard
提问by Greeso
As the title says, I would like to remove a constraint that is already set in the storyboard. However I did not find any UI option in Xcode that allows me to do so. How can I remove an already existing constraint?
正如标题所说,我想删除故事板中已经设置的约束。但是我没有在 Xcode 中找到任何允许我这样做的 UI 选项。如何删除已经存在的约束?
Thanks.
谢谢。
回答by rdelmar
Just select the view you want to remove a constraint from and open the size inspector. You should see a list of all the constraints. Select the one you want to delete, and press the delete key.
只需选择要从中删除约束的视图并打开尺寸检查器。您应该会看到所有约束的列表。选择要删除的一项,然后按删除键。
回答by KTPATEL
Click on a constraint that you want to delete in the Size inspector, it covers with a thin blue border. Even you can select multiple constraints in Size inspector by keep holding command key. The constraint(s) can then be removed/deleted using the backspace.
在大小检查器中单击要删除的约束,它会覆盖一个蓝色的细边框。即使您可以通过按住命令键在尺寸检查器中选择多个约束。然后可以使用退格键移除/删除约束。
Or
或者
You can double click on constraint that you want to delete in the Size inspector and it will shows details of constraint in size inspector. Hit Delete button and it will remove/delete the constraint.
您可以在尺寸检查器中双击要删除的约束,它将在尺寸检查器中显示约束的详细信息。点击删除按钮,它将删除/删除约束。
回答by KTPATEL
Open Utilities panel on XCode and select Size Inspector. Here list of all constraints are listed for selected view in storyboard. Now, select constraint(s) you want to delete. Now hit Backspace key on keyboard and selected constraints are deleted.
在 XCode 上打开 Utilities 面板并选择 Size Inspector。这里列出了故事板中选定视图的所有约束列表。现在,选择要删除的约束。现在点击键盘上的 Backspace 键并删除选定的约束。