问题
I am using TRMosaicLayout to achieve a SnapChat like layout.
However, after using it, I noticed that viewForSupplementaryElementOfKind
is no longer called. Any thoughts?
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
print("THIS FUNCTION IS NO LONGER CALLED");
var view: UICollectionReusableView! = UICollectionReusableView();
switch kind {
case UICollectionElementKindSectionFooter:
loadingFooterView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "loadingFooterIdentifier", for: indexPath) as! LoadingFooterCollectionReusableView;
view = loadingFooterView;
default:
break;
}
return view;
}
来源:https://stackoverflow.com/questions/43221323/using-custom-layout-causes-collectionviewflowlayout-delegate-function-not-being