Like the title says, I have searched around but had no luck. Is it possible to connect the stack view to the .swift file and then adjust the spacing programmatically? Thank you!
Programmatically Set Spacing on Stackview
Asked Answered
let stackView = UIStackView()
stackView.spacing = 10.0 // or whatever you like
In case you have a custom UIStackView
class YourCustomSublcass {
//MARK: Initialization of the stackView
override init(frame: CGRect) {
super.init(frame: frame)
self.spacing = 8.0
}
required init(coder :NSCoder){
super.init(coder: coder)
self.spacing = 8.0
}
}
© 2022 - 2024 — McMap. All rights reserved.