Open sphairo opened 6 years ago
in objective-c
not works
in swift:
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
return CGSize(width: self.view.frame.size.width, height: 120) }
not works :(
only i can change size item with this code:
let layout:APLExpandableSectionFlowLayout = self.collectionView.collectionViewLayout as! APLExpandableSectionFlowLayout layout.itemSize = CGSizeMake(self.view.frame.size.width, 120); layout.minimumLineSpacing = 4 layout.scrollDirection = .Vertical layout.sectionInset = UIEdgeInsetsMake(8, 8, 0, 8);
but i need to do by NSIndexPath
Correct. This library works only for CollectionViews where every cell has the same size. See #5.
in objective-c
not works
in swift:
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
not works :(
only i can change size item with this code:
let layout:APLExpandableSectionFlowLayout = self.collectionView.collectionViewLayout as! APLExpandableSectionFlowLayout layout.itemSize = CGSizeMake(self.view.frame.size.width, 120); layout.minimumLineSpacing = 4 layout.scrollDirection = .Vertical layout.sectionInset = UIEdgeInsetsMake(8, 8, 0, 8);
but i need to do by NSIndexPath