[英]Change the collection view cell size
我想調整FSCalendar
的日期框架大小,該大小在collectionView
單元內。
請幫助我在FSCalendar
更改集合視圖單元格的大小。
在添加UICollectionViewDelegateFlowLayout之后使用此函數:
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: screenWidth, height: screenWidth)
}
您可以使用UICollectionView委托方法來更改CollectionView的高度和寬度
在斯威夫特
public func collectionView(_ collectionView: UICollectionView, transitionLayoutForOldLayout fromLayout: UICollectionViewLayout, newLayout toLayout: UICollectionViewLayout) -> UICollectionViewTransitionLayout
func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.