This commit is contained in:
John Estropia
2020-08-30 10:24:10 +09:00
parent b26e50f777
commit 007da014f8
7 changed files with 12 additions and 113 deletions

View File

@@ -33,7 +33,10 @@ extension Modern.PokedexDemo {
let screenWidth = UIScreen.main.bounds.inset(by: layout.sectionInset).width
let cellsPerRow: CGFloat = 3
let cellWidth = floor((screenWidth - ((cellsPerRow - 1) * layout.minimumInteritemSpacing)) / cellsPerRow)
let cellWidth = min(
230,
floor((screenWidth - ((cellsPerRow - 1) * layout.minimumInteritemSpacing)) / cellsPerRow)
)
layout.itemSize = .init(
width: cellWidth,
height: ceil(cellWidth * (4 / 3))