我有一个 Swift 中的 UIView
let postDiv: UIView = {
let div = UIView()
return div
}()
profile_view.addSubview(postDiv)
profile_view.addSubview(PostDiv)
profile_view.addSubview(PostDiv)
当我仅添加其中一个作为 subview 时,它可以工作,但是当我添加几个时,它们相互重叠,因此只有其中一个可见,我如何向它们添加彼此的 anchor 。这是我当前的 anchor
postDiv.anchor(postsDiv.bottomAnchor, left:view.leftAnchor, bottom: nil, right: view.rightAnchor, topConstant: 40, leftConstant: 15, bottomConstant: 0, rightConstant: 15, widthConstant: 0, heightConstant: 165)
最佳答案
在您的情况下,我将使用 UITableView
作为您想要实现的行列表
关于ios - 相同元素的快速锚定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42959029/