I'm adding labels to a stackview and I'm having trouble getting them to add to the top of the stackview rather than the middle.
I'm trying to accomplish this with the following code:
let textLabel = UILabel()
textLabel.textColor = .white
textLabel.widthAnchor.constraint(equalToConstant: self.stkCombatStackView.frame.width).isActive = true
textLabel.text = "This is a test"
textLabel.textAlignment = .left
stackview.addArrangedSubview(textLabel)
I want the labels to be added from top to bottom, how can I do this? without the weird spacing?
I have the spacing in the inspector set to 1
(I also have the stackview nested in a scrollview in the storyboard but i can't seem to scroll the stackview at all)