my collectionview starts out like this: initial screen
when the user swipes up on the collection it expands like so: second screen
how can I change the size of the cells when the collection view expands?
my collectionview starts out like this: initial screen
when the user swipes up on the collection it expands like so: second screen
how can I change the size of the cells when the collection view expands?
In english:
You need to set the cells' height equals to the collection view height, and every time the collection resize you need to refresh the layout.
In iOS language
you need to conform your view controller the the UICollectionViewDelegateFlowLayout
and use the
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize
to resize the cells
extension YourViewController: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let height = collectionView.frame.size.height
let width = //make your calculation
return CGSize(width: width, height: height)
}
}
something like this