解决集合视图的header遮住滚动条
2018-12-11 本文已影响1人
CYC666
实现集合视图的这个方法即可
- (void)collectionView:(UICollectionView*)collectionView willDisplaySupplementaryView:(UICollectionReusableView*)view forElementKind:(NSString*)elementKind atIndexPath:(NSIndexPath*)indexPath {
// 解决header遮住滚动条
if(@available(iOS11.0, *)) {
if ([elementKind isEqualToString:UICollectionElementKindSectionHeader]) {
view.layer.zPosition=0;
}
}
}