From 1d3150c62047242a3233ab728c3a2ccea0a86e1d Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 26 Jul 2021 15:50:35 +0800 Subject: [PATCH] fix: label layout and hashtag search result title not display issue --- Mastodon/Extension/MetaLabel.swift | 3 ++- .../TableViewCell/SearchResultTableViewCell.swift | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Mastodon/Extension/MetaLabel.swift b/Mastodon/Extension/MetaLabel.swift index 27f04e06..e5a588e1 100644 --- a/Mastodon/Extension/MetaLabel.swift +++ b/Mastodon/Extension/MetaLabel.swift @@ -26,7 +26,8 @@ extension MetaLabel { layer.masksToBounds = true textContainer.lineBreakMode = .byTruncatingTail - + textContainer.lineFragmentPadding = 0 + let font: UIFont let textColor: UIColor diff --git a/Mastodon/Scene/Search/SearchDetail/TableViewCell/SearchResultTableViewCell.swift b/Mastodon/Scene/Search/SearchDetail/TableViewCell/SearchResultTableViewCell.swift index 4c1753ff..46c0f663 100644 --- a/Mastodon/Scene/Search/SearchDetail/TableViewCell/SearchResultTableViewCell.swift +++ b/Mastodon/Scene/Search/SearchDetail/TableViewCell/SearchResultTableViewCell.swift @@ -180,7 +180,8 @@ extension SearchResultTableViewCell { configure(with: AvatarConfigurableViewConfiguration(avatarImageURL: nil)) let image = UIImage(systemName: "number.circle.fill", withConfiguration: UIImage.SymbolConfiguration(pointSize: 34, weight: .regular))!.withRenderingMode(.alwaysTemplate) _imageView.image = image - _titleLabel.text = "#" + tag.name + let metaContent = PlaintextMetaContent(string: "#" + tag.name) + _titleLabel.configure(content: metaContent) guard let histories = tag.history else { _subTitleLabel.text = "" return @@ -195,7 +196,8 @@ extension SearchResultTableViewCell { configure(with: AvatarConfigurableViewConfiguration(avatarImageURL: nil)) let image = UIImage(systemName: "number.circle.fill", withConfiguration: UIImage.SymbolConfiguration(pointSize: 34, weight: .regular))!.withRenderingMode(.alwaysTemplate) _imageView.image = image - _titleLabel.text = "# " + tag.name + let metaContent = PlaintextMetaContent(string: "#" + tag.name) + _titleLabel.configure(content: metaContent) guard let histories = tag.histories?.sorted(by: { $0.createAt.compare($1.createAt) == .orderedAscending }) else {