[英]Change the collection view cell size
I want to resize FSCalendar
's date frame size, which is inside the collectionView
cell. 我想调整FSCalendar
的日期框架大小,该大小在collectionView
单元内。
Please help me change the collection view cell size in FSCalendar
. 请帮助我在FSCalendar
更改集合视图单元格的大小。
use this function after adding UICollectionViewDelegateFlowLayout : 在添加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 您可以使用UICollectionView委托方法来更改CollectionView的高度和宽度
in Swift 在斯威夫特
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.