gpt4 book ai didi

ios - 彼此相同元素的 Swift anchor

转载 作者:可可西里 更新时间:2023-11-01 01:23:03 26 4
gpt4 key购买 nike

我在 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 - 彼此相同元素的 Swift anchor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42959029/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com