简体   繁体   English

使用UITableViewCell进行自动布局约束以显示两个视图

[英]Autolayout constraints with UITableViewCell to display two Views

I have a UITableViewCell which has two UIViews, I want these two views to appear and resize as per screen size. 我有一个具有两个UIViews的UITableViewCell,我希望这两个视图出现并根据屏幕大小调整大小。 Please see attached images to get an idea what I am trying to achieve, I have also attached constrains I have tried. 请查看附件中的图片以了解我要实现的目标,并且还附加了我尝试过的约束。

在此处输入图片说明

在此处输入图片说明

Please correct , whats wrong with this. 请更正,这有什么问题。

What you need to do is select both views and select the constraints 您需要做的是同时选择两个视图并选择约束

  • "Equal Widths" “等宽”
  • "Equal Heights" “平等的高度”
  • "Align" -> "Vertical centers" “对齐”->“垂直中心”

and then the margin between them and margins to superview 然后它们之间的边距和要进行监督的边距

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 UITableViewCell和AutoLayout打破约束的两种状态 - Two states on UITableViewCell and AutoLayout breaking constraints UITableViewCellStyleSubtitle的UITableViewCell上的自动布局约束 - AutoLayout Constraints on UITableViewCell of UITableViewCellStyleSubtitle 具有自动布局的iOS 7 UITableViewCell中的约束冲突 - Conflicting constraints in iOS 7 UITableViewCell with AutoLayout 对UITableViewCell contentView的AutoLayout约束不受尊重 - AutoLayout constraints to UITableViewCell contentView not respected UITableViewCell子视图不符合Autolayout约束 - UITableViewCell subviews are not honoring the Autolayout constraints UIImageView忽略UITableViewCell中的AutoLayout约束 - UIImageView Ignores AutoLayout Constraints in UITableViewCell 如何在Xcode Playground中使用自动布局约束显示视图? - How can I display views using autolayout constraints in Xcode playground? iOS-约束-UITableViewCell中彼此相邻的两个视图 - iOS - Constraints - Two Views next to each other in UITableViewCell 自定义 UITableViewCell 的自动布局在 Swift 5 中发现冲突的约束 - Autolayout of custom UITableViewCell finds conflicting constraints in Swift 5 无法将自动布局约束添加到UITableViewCell中的元素 - Unable to add AutoLayout constraints to elements in UITableViewCell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM