fix: status meta label in thread may get trimmed issue

This commit is contained in:
CMK 2021-08-10 18:50:41 +08:00
parent 3a8d1fa61a
commit f495b16464
1 changed files with 6 additions and 2 deletions

View File

@ -13,6 +13,8 @@ final class ThreadMetaView: UIView {
let label = UILabel() let label = UILabel()
label.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 15, weight: .regular)) label.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 15, weight: .regular))
label.text = "Date" label.text = "Date"
label.adjustsFontSizeToFitWidth = true
label.minimumScaleFactor = 0.5
return label return label
}() }()
@ -75,8 +77,10 @@ extension ThreadMetaView {
actionButtonStackView.addArrangedSubview(favoriteButton) actionButtonStackView.addArrangedSubview(favoriteButton)
dateLabel.setContentHuggingPriority(.defaultLow, for: .horizontal) dateLabel.setContentHuggingPriority(.defaultLow, for: .horizontal)
reblogButton.setContentHuggingPriority(.required - 2, for: .horizontal) reblogButton.titleLabel?.setContentHuggingPriority(.required - 2, for: .horizontal)
favoriteButton.setContentHuggingPriority(.required - 1, for: .horizontal) favoriteButton.titleLabel?.setContentHuggingPriority(.required - 1, for: .horizontal)
reblogButton.setContentCompressionResistancePriority(.required - 2, for: .horizontal)
favoriteButton.setContentCompressionResistancePriority(.required - 1, for: .horizontal)
updateContainerLayout() updateContainerLayout()