I have a UIStackView
however, the first view of the subViews
is a UILabel
and it is not sizing it accordingly.
My code is as per below;
private let stackView: UIStackView = {
let view = UIStackView()
view.translatesAutoresizingMaskIntoConstraints = false
view.axis = .horizontal
view.distribution = .fillProportionally
view.alignment = .trailing
view.spacing = 8
return view
}()
and I, of course, add my subViews
within init
as below;
stackView.addArrangedSubview(currentBidLabel)
stackView.addArrangedSubview(seperator)
stackView.addArrangedSubview(adCreatedAtLabel)
stackView.addArrangedSubview(moreButton)
My current result is as per the illustration below;
The result I'm looking for is the following;
- Red = Dynamic Label Width (same as Blue)
- Green = Fixed Width
- Blue = Fill Remaining Space
- Cyan = Fixed Width