private lazy var stackView: UIStackView = {
        let v = UIStackView()
        v.axis = .horizontal           //主轴方向 水平排列
        v.alignment = .center          //垂直主轴方向 居中对齐
//        v.distribution = .equalSpacing // 每个 view 之间的间距相等
        v.distribution = .fill          //分配主轴空间 默认充满
        v.spacing = 4                  // 子视图之间的间距 4pt
        return v
    }()

 

 

image

 

 

 

image

 

posted on 2025-12-12 15:43  懂事长qingzZ  阅读(0)  评论(0)    收藏  举报