之间的间距如何我每个单元之间添加间距在这里 -小贴士把细胞
for i in 0...50 {
let cell = UIView()
cell.backgroundColor = .lightGray
cell.frame = CGRect(x: Double(i) * Double(32.52), y: 90, width: 350, height: 500)
view.addSubview(cell)
}
因为与视图上面的代码看起来像这样
你究竟想要做什么?它看起来像你的代码只是在彼此之上放置一堆视图。也许你应该将视图宽度设置为32.52,将x位置设置为Double(i)* Double(32.52)+ i * 3',以便在单元格之间给出3个点的空间。 – toddg