如何解决 Xcode 上 Storyboard 的警告?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46557266/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:20:36  来源:igfitidea点击:

How to resolve the Storyboard's warnings on Xcode?

iosxcodestoryboard

提问by yosei

Trailing(Leading) constraint is missing, which may cause overlapping with other views

My storyboard: (just put 2 labels and their constraints)

我的故事板:(只需放 2 个标签及其约束)

storyboard

故事板

enter image description here

在此处输入图片说明

What is the best way to avoid these warnings?

避免这些警告的最佳方法是什么?

回答by iVarun

  • Give Trailingto Hello, Label with World! label like below image give Constant8 (What minimum gap you need) to Trailing constraint and change Relation to Grater than or Equal.
  • 尾随你好,标签与世界!如下图所示的标签将常量8(您需要的最小间隙)设置为 Trailing 约束并将 Relation 更改为Grater than 或 Equal

enter image description here

在此处输入图片说明