From 07f3cc7a77382f3abf4a69c245ca99b722902864 Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 16 Mar 2021 16:17:11 +0800 Subject: [PATCH] fix: author info UI layout issue --- .../ComposeTootContentTableViewCell.swift | 2 ++ .../Scene/Share/View/Content/StatusView.swift | 21 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Mastodon/Scene/Compose/TableViewCell/ComposeTootContentTableViewCell.swift b/Mastodon/Scene/Compose/TableViewCell/ComposeTootContentTableViewCell.swift index 95e49c63a..9f39f1989 100644 --- a/Mastodon/Scene/Compose/TableViewCell/ComposeTootContentTableViewCell.swift +++ b/Mastodon/Scene/Compose/TableViewCell/ComposeTootContentTableViewCell.swift @@ -53,6 +53,8 @@ extension ComposeTootContentTableViewCell { ]) statusView.statusContainerStackView.isHidden = true statusView.actionToolbarContainer.isHidden = true + statusView.nameTrialingDotLabel.isHidden = true + statusView.dateLabel.isHidden = true textEditorView.translatesAutoresizingMaskIntoConstraints = false contentView.addSubview(textEditorView) diff --git a/Mastodon/Scene/Share/View/Content/StatusView.swift b/Mastodon/Scene/Share/View/Content/StatusView.swift index 5e501b92f..3987aa5fc 100644 --- a/Mastodon/Scene/Share/View/Content/StatusView.swift +++ b/Mastodon/Scene/Share/View/Content/StatusView.swift @@ -71,6 +71,14 @@ final class StatusView: UIView { return label }() + let nameTrialingDotLabel: UILabel = { + let label = UILabel() + label.textColor = Asset.Colors.Label.secondary.color + label.font = .systemFont(ofSize: 17) + label.text = "·" + return label + }() + let usernameLabel: UILabel = { let label = UILabel() label.font = .systemFont(ofSize: 15, weight: .regular) @@ -268,18 +276,11 @@ extension StatusView { nameLabel.heightAnchor.constraint(equalToConstant: 22).priority(.defaultHigh), ]) titleContainerStackView.alignment = .firstBaseline - let dotLabel: UILabel = { - let label = UILabel() - label.textColor = Asset.Colors.Label.secondary.color - label.font = .systemFont(ofSize: 17) - label.text = "·" - return label - }() - titleContainerStackView.addArrangedSubview(dotLabel) + titleContainerStackView.addArrangedSubview(nameTrialingDotLabel) titleContainerStackView.addArrangedSubview(dateLabel) nameLabel.setContentHuggingPriority(.defaultHigh + 1, for: .horizontal) - dotLabel.setContentHuggingPriority(.defaultHigh + 2, for: .horizontal) - dotLabel.setContentCompressionResistancePriority(.required - 2, for: .horizontal) + nameTrialingDotLabel.setContentHuggingPriority(.defaultHigh + 2, for: .horizontal) + nameTrialingDotLabel.setContentCompressionResistancePriority(.required - 2, for: .horizontal) dateLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal) dateLabel.setContentCompressionResistancePriority(.required - 1, for: .horizontal)