Try again

This commit is contained in:
Pfeil, Scott Robert 2020-05-22 15:30:02 -04:00
parent 8fdb4c3e14
commit 740545e9c3
2 changed files with 9 additions and 9 deletions

View File

@ -674,12 +674,15 @@ public typealias ActionBlock = () -> ()
setScale(scale)
}
open override func layoutSubviews() {
super.layoutSubviews()
// This fixes a defect for when there are multiple labels stacked in a list item. Sometime some labels will not fill their available space.
preferredMaxLayoutWidth = frame.width
}
@objc public func updateView(_ size: CGFloat) {
scaleSize = size as NSNumber
// This fixes a defect for when there are multiple labels stacked in a list item. Sometime some labels will not fill their available space.
preferredMaxLayoutWidth = size
if let originalAttributedString = originalAttributedString {
let attributedString = NSMutableAttributedString(attributedString: originalAttributedString)
attributedString.removeAttribute(.font, range: NSRange(location: 0, length: attributedString.length))
@ -878,10 +881,6 @@ extension Label {
return true
}
public func horizontalAlignment() -> UIStackView.Alignment {
return .leading
}
public func copyBackgroundColor() -> Bool {
return true
}

View File

@ -21,7 +21,7 @@ import Foundation
//--------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .fill)),
(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .leading))],
(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .fill))],
axis: .horizontal)
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
@ -35,6 +35,7 @@ import Foundation
//--------------------------------------------------
override open func setupView() {
super.setupView()
leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal)
addMolecule(stack)
stack.restack()
}