Skip to content

Commit

Permalink
修复 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
leejayID committed Jun 2, 2017
1 parent 38ebe57 commit 28f1c70
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Linkage/CollectionView/CollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,11 @@ extension CollectionViewController {

fileprivate func frameForHeader(section: Int) -> CGRect {
let indexPath = IndexPath(item: 0, section: section)
let attributes = collectionView.layoutAttributesForSupplementaryElement(ofKind: UICollectionElementKindSectionHeader, at: indexPath)

let attributes = collectionView.collectionViewLayout.layoutAttributesForSupplementaryView(ofKind: UICollectionElementKindSectionHeader, at: indexPath)
guard let frameForFirstCell = attributes?.frame else {
return .zero
}

let headerHeight = collectionView(collectionView, layout: flowlayout, referenceSizeForHeaderInSection: section).height
return frameForFirstCell.offsetBy(dx: 0, dy: -headerHeight);
return frameForFirstCell;
}
}

Expand Down

0 comments on commit 28f1c70

Please sign in to comment.