I am creating a chess board and want to use UICollectionView to do the grid layout. The problem is, I don't know how to set the number of columns to always be 8, so as to create a 8x8 grid.
I understand that UICollectionViewDelegateFlowLayout
can be implemented to control the size of the items, but my question is will it work across all iOS devices (iPhone 4s - iPhone 6+, iPads). From what I have seen, it looks like i need to handle the size of the cells individually by each device type.
UICollectionView Set number of columns
Is anyone aware of a better solution to the problem?
I'd forget the UICollectionView and go the a SpriteKit game. That will leave you way more control. You can even add a Game Scene in an "ordinary" iOS app.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.