var subView1: UIButton = {
let v = UIButton()
v.setTitle("subView1", for: .normal)
v.setTitleColor(.white, for: .normal)
v.titleLabel?.font = UIFont(name: "AppleSDGothicNeo-SemiBold", size: 10)
v.layer.cornerRadius = 20
v.backgroundColor = .red
return v
}()
var subView2: UIButton = {
let v = UIButton()
v.setTitle("subView1", for: .normal)
v.setTitleColor(.white, for: .normal)
v.titleLabel?.font = UIFont(name: "AppleSDGothicNeo-SemiBold", size: 10)
v.layer.cornerRadius = 20
v.backgroundColor = .orange
return v
}()
var subView3: UIButton = {
let v = UIButton()
v.setTitle("subView1", for: .normal)
v.setTitleColor(.white, for: .normal)
v.titleLabel?.font = UIFont(name: "AppleSDGothicNeo-SemiBold", size: 10)
v.layer.cornerRadius = 20
v.backgroundColor = .yellow
return v
}()
lazy var stackView: UIStackView = {
let sv = UIStackView(arrangedSubviews: [subView1, subView2, subView3])
sv.axis = .vertical
sv.alignment = .fill
sv.distribution = .fillEqually
sv.translatesAutoresizingMaskIntoConstraints = false
sv.spacing = 10
return sv
}()
lazy var stackView: UIStackView = {
let sv = UIStackView(arrangedSubviews: [subView1, subView2, subView3])
sv.axis = .vertical
sv.distribution = .fillEqually
sv.translatesAutoresizingMaskIntoConstraints = false
sv.spacing = 10
return sv
}()
let sv = UIStackView(arrangedSubviews: [subView1, subView2, subView3])
sv.axis = .vertical