From c1971438cdf0a493b0d5619d09d1ab87f25a6867 Mon Sep 17 00:00:00 2001 From: sunxiaojian Date: Thu, 8 Apr 2021 14:17:57 +0800 Subject: [PATCH] fix: acctLabel display beyound card --- .../SearchRecommendAccountsCollectionViewCell.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mastodon/Scene/Search/CollectionViewCell/SearchRecommendAccountsCollectionViewCell.swift b/Mastodon/Scene/Search/CollectionViewCell/SearchRecommendAccountsCollectionViewCell.swift index b6eafb3f9..cda517f43 100644 --- a/Mastodon/Scene/Search/CollectionViewCell/SearchRecommendAccountsCollectionViewCell.swift +++ b/Mastodon/Scene/Search/CollectionViewCell/SearchRecommendAccountsCollectionViewCell.swift @@ -41,6 +41,7 @@ class SearchRecommendAccountsCollectionViewCell: UICollectionViewCell { let label = UILabel() label.textColor = .white label.font = .preferredFont(forTextStyle: .body) + label.textAlignment = .center label.translatesAutoresizingMaskIntoConstraints = false return label }() @@ -105,6 +106,8 @@ extension SearchRecommendAccountsCollectionViewCell { contentView.addSubview(acctLabel) acctLabel.constrain([ acctLabel.constraint(.top, toView: contentView, constant: 132), + acctLabel.constraint(.leading, toView: contentView), + acctLabel.constraint(.trailing, toView: contentView), acctLabel.constraint(.centerX, toView: contentView) ])