mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-17 10:43:30 +01:00
Fixes incorrect cell height for some News items
We need to take layoutMargins into account when calculating the height of the prototype cell.
This commit is contained in:
@@ -450,6 +450,10 @@ extension NewsViewController: UICollectionViewDelegateFlowLayout
|
|||||||
return previousSize
|
return previousSize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Take layout margins into account.
|
||||||
|
self.prototypeCell.layoutMargins.left = self.view.layoutMargins.left
|
||||||
|
self.prototypeCell.layoutMargins.right = self.view.layoutMargins.right
|
||||||
|
|
||||||
let widthConstraint = self.prototypeCell.contentView.widthAnchor.constraint(equalToConstant: collectionView.bounds.width)
|
let widthConstraint = self.prototypeCell.contentView.widthAnchor.constraint(equalToConstant: collectionView.bounds.width)
|
||||||
NSLayoutConstraint.activate([widthConstraint])
|
NSLayoutConstraint.activate([widthConstraint])
|
||||||
defer { NSLayoutConstraint.deactivate([widthConstraint]) }
|
defer { NSLayoutConstraint.deactivate([widthConstraint]) }
|
||||||
|
|||||||
Reference in New Issue
Block a user