核心代码:
let spacerView = UIView()
spacerView.setContentHuggingPriority(.defaultLow, for: .horizontal)
stack.addArrangedSubview(spacerView)
参考:https://gist.github.com/morishin/639f5ff12c544eac9d7c64acbca54270
核心代码:
let spacerView = UIView()
spacerView.setContentHuggingPriority(.defaultLow, for: .horizontal)
stack.addArrangedSubview(spacerView)
参考:https://gist.github.com/morishin/639f5ff12c544eac9d7c64acbca54270
本文标题:UIStackView靠一边排列
本文链接:https://www.haomeiwen.com/subject/fgxpectx.html
网友评论