简体   繁体   中英

Change the collection view cell size

I want to resize FSCalendar 's date frame size, which is inside the collectionView cell.

Please help me change the collection view cell size in FSCalendar .

use this function after adding UICollectionViewDelegateFlowLayout :

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
         return CGSize(width: screenWidth, height: screenWidth)
    }

you can use UICollectionView Delegate Methods for changing height and width of CollectionView

in Swift

public func collectionView(_ collectionView: UICollectionView, transitionLayoutForOldLayout fromLayout: UICollectionViewLayout, newLayout toLayout: UICollectionViewLayout) -> UICollectionViewTransitionLayout


func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool)

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM