fix: author info UI layout issue

This commit is contained in:
CMK 2021-03-16 16:17:11 +08:00
parent 96c1488820
commit 07f3cc7a77
2 changed files with 13 additions and 10 deletions

View File

@ -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)

View File

@ -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)