사용자가 UICollectionView
의 맨 아래로 스크롤 할 때 셀의 다음 페이지를 자동으로로드하려고합니다.UICollectionView 아래에 추가 셀로드
UICollectoinView
하단에 UIButton
을 추가하여 입력 할 수 있습니다. 사용자가 꼬리말로 스크롤하여 버튼을 터치하면 새 셀이 올바르게 추가됩니다. 더 많은 페이지를 추가하기 위해 바닥 글에 UIButton
을 다시 터치 할 수 있습니다. 전체 UICollectionView
블랭크 아웃
- (UICollectionReuseableView *)collectionView: (UICollectionView *)collectionView viewForSupplementaryElementOfKind: (NSString *)kind atIndexPath: (NSIndexPath *) indexPath
{
// code for headerView
// ...
// code for footerView
MySupplementalFooter *footerView = nil;
if ([kind isEqual:UICollectionElementKindSectionFooter])
{
footerView = [self.collectionView dequeueReuseableSupplemntaryViewOfKind:kind withReuseIdentifier:@"FooterId" forIndexPath:indexPath];
if (LoadMoreIsEnabled)
{
footerView.loadMoreFooterButton.setHidden:NO];
[self loadMoreFooterButtonAction]; // calls the method to add cells to the dictionary for cv
} else
{
footerView.loadMoreFooterButton setHidden:YES];
}
return footerView;
}
}
loadMoreFooterButtonAction
메소드 호출되지만 :
UICollectionView
을 새로 고치면 다시 가져 오지 않습니다.
'UICollectionView가 OMG을 공백으로 만들었습니다. 제 경우는'willDisplayCell'으로 일반적인 방법을 시도했지만 콜렉션 뷰는 재설정되고 공백 (wtf)이됩니다. 마지막으로'scrollViewDidScroll'을 사용하여 구현됩니다. – SoftDesigner