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 }