From ba0f9f1cd9738ae9ae6a7bfa8a2bd48bef9067ff Mon Sep 17 00:00:00 2001 From: baegteun Date: Sun, 25 Aug 2024 17:57:35 +0900 Subject: [PATCH] =?UTF-8?q?:lipstick:=20::=20[#1223]=20=EC=9E=91=EC=97=85?= =?UTF-8?q?=EC=9E=90=20=EC=9D=B4=EB=A6=84=EC=9D=B4=20=EA=B8=B8=EC=96=B4?= =?UTF-8?q?=EC=A7=88=20=EB=95=8C=EB=A5=BC=20=EC=9C=84=ED=95=9C=20=EC=B5=9C?= =?UTF-8?q?=EB=8C=80=20width?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreditCollectionView/CreditCollectionViewCell.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Projects/Features/SongCreditFeature/Sources/View/CreditCollectionView/CreditCollectionViewCell.swift b/Projects/Features/SongCreditFeature/Sources/View/CreditCollectionView/CreditCollectionViewCell.swift index 45d0431cc..8dbd848a4 100644 --- a/Projects/Features/SongCreditFeature/Sources/View/CreditCollectionView/CreditCollectionViewCell.swift +++ b/Projects/Features/SongCreditFeature/Sources/View/CreditCollectionView/CreditCollectionViewCell.swift @@ -35,9 +35,16 @@ final class CreditCollectionViewCell: UICollectionViewCell { ) -> UICollectionViewLayoutAttributes { setNeedsLayout() layoutIfNeeded() + let collectionViewWidth = superview?.bounds.width ?? UIScreen.main.bounds.width + + let maxWidth = collectionViewWidth * 0.6 + let size = contentView.systemLayoutSizeFitting(layoutAttributes.size) var newFrame = layoutAttributes.frame - newFrame.size = size + newFrame.size = .init( + width: min(maxWidth, size.width), + height: size.height + ) layoutAttributes.frame = newFrame return layoutAttributes }