草庐IT

ViewControllerCells

全部标签

ios - 以编程方式向 ViewControllerCells 添加约束

使用CollectionViewCells创建一个“卡片式”菜单,我需要单元格在|------|之间具有相同的空间任何屏幕尺寸。我能够做到这一点:addConstraints(NSLayoutConstraint.constraints(withVisualFormat:"H:|-15-[v0]-15-|",options:NSLayoutFormatOptions(),metrics:nil,views:["v0":appsCollectionView]))addConstraints(NSLayoutConstraint.constraints(withVisualFormat:"