chaneeii / iOS-Study-Log

✨ iOS에 대해 공부한 것들을 기록합니다 ✨
18 stars 0 forks source link

UIStackView #49

Open chaneeii opened 2 years ago

chaneeii commented 2 years ago
chaneeii commented 2 years ago
lazy var stackView: UIStackView = {
        //arrangedSubviews <- 안에 있는 값은 클래스에서 불러온값 
        let stackV = UIStackView(arrangedSubviews: [stackviewF.view1, stackviewF.view2, stackviewF.view3])

        stackV.translatesAutoresizingMaskIntoConstraints = false
        stackV.axis = .horizontal
        stackV.spacing = 10
        stackV.distribution = .fillEqually

        return stackV
    }()
chaneeii commented 2 years ago

커스텀 스페이싱

let stackView = UIStackView()
let btn = UIButton()

stackView.addArrangedSubview(btn)
stackView.setCustomSpacing(20, after: btn)
chaneeii commented 2 years ago

https://jeonyeohun.tistory.com/m/195