From f495b16464f38531381c2f988c8f871b174de265 Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 10 Aug 2021 18:50:41 +0800 Subject: [PATCH] fix: status meta label in thread may get trimmed issue --- Mastodon/Scene/Share/View/Content/ThreadMetaView.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Mastodon/Scene/Share/View/Content/ThreadMetaView.swift b/Mastodon/Scene/Share/View/Content/ThreadMetaView.swift index ff2f94a0e..d6f1b01a9 100644 --- a/Mastodon/Scene/Share/View/Content/ThreadMetaView.swift +++ b/Mastodon/Scene/Share/View/Content/ThreadMetaView.swift @@ -13,6 +13,8 @@ final class ThreadMetaView: UIView { let label = UILabel() label.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 15, weight: .regular)) label.text = "Date" + label.adjustsFontSizeToFitWidth = true + label.minimumScaleFactor = 0.5 return label }() @@ -75,8 +77,10 @@ extension ThreadMetaView { actionButtonStackView.addArrangedSubview(favoriteButton) dateLabel.setContentHuggingPriority(.defaultLow, for: .horizontal) - reblogButton.setContentHuggingPriority(.required - 2, for: .horizontal) - favoriteButton.setContentHuggingPriority(.required - 1, for: .horizontal) + reblogButton.titleLabel?.setContentHuggingPriority(.required - 2, for: .horizontal) + favoriteButton.titleLabel?.setContentHuggingPriority(.required - 1, for: .horizontal) + reblogButton.setContentCompressionResistancePriority(.required - 2, for: .horizontal) + favoriteButton.setContentCompressionResistancePriority(.required - 1, for: .horizontal) updateContainerLayout()