mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +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:
committed by
Nythepegasus
parent
f97548fc3a
commit
cfcfc3e928
@@ -426,6 +426,10 @@ extension NewsViewController: UICollectionViewDelegateFlowLayout
|
||||
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)
|
||||
NSLayoutConstraint.activate([widthConstraint])
|
||||
defer { NSLayoutConstraint.deactivate([widthConstraint]) }
|
||||
|
||||
Reference in New Issue
Block a user