chaneeii / iOS-Study-Log

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

UIStackView #49

Open chaneeii opened 1 year ago

chaneeii commented 1 year ago
chaneeii commented 1 year 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 1 year ago

커스텀 스페이싱

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

stackView.addArrangedSubview(btn)
stackView.setCustomSpacing(20, after: btn)
chaneeii commented 1 year ago

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