Pet*_*ter 3 xcode ios autolayout swift uistackview
我正在尝试解决我们在UITableViewCell. 有UIStackView带有子视图的嵌套,例如UILabel具有内在的内容大小。我创建这个示例是为了简化解释我的问题:
导致这些界面生成器错误:
Top Stack
View Need constraints for: Y position, height
Middle Stack
View Need constraints for: Y position, height
Bottom Stack
View Need constraints for: Y position, height
Run Code Online (Sandbox Code Playgroud)
UILabels 及其内在内容大小决定。UIStackView具有Fill对齐和分布属性。缺什么?我创建了一个托管在 GitHub 上的示例项目。
您必须将OutterStackView底部约束设置为greater than or equal单元格内容视图的底部。
看到的问题是,您要求OutterStackView与 StoryBoard 中的单元格大小相同,但由于您的内部标签还没有最终的内在内容大小,因此您无法满足所有约束要求。