1
위로/아래로 스크롤하는 동안 UICollectionView의 방법을 아는 사람이 있습니까? 아래로 스크롤하는 동안 UICollectionView의 머리글을 변경해야합니다. 고유 한 일정보기를 수행하고 있습니다.Objective-C UICollectionView 위쪽/아래쪽 스크롤
나는 위로 스크롤하고있는 동안 헤더 섹션
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
ASCalendarHeaderView *calHeader = [self.calCollectView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"CalendarHeader" forIndexPath:indexPath];
calHeader.MonthYearLabel.text = [calendar getCurrentMonthYear:calendar.today];
[calHeader setNeedsDisplay];
calHeader.MonthYearLabel.textAlignment = NSTextAlignmentRight;
if (indexPath.section){
[calendar getNextMonth:calendar.today];
NSLog(@"Some Text");
}
return calHeader;
}
보기 그러나 증가 달을 생성하는 방법을 다음했다. 스크롤하는 동안과 스크롤 할 때 별도로 사용하는 방법이 있습니까?
감사
죄송합니다, 내가 어떻게 할 수있는이 메서드에서 CollectionView에 대한 헤더 변경합니까? – Anton
매번 새로운 헤더를 만드는 대신, 헤더에 클래스 변수를 넣고 메소드에 반환하면됩니다. 그것은 클래스 변수이기 때문에 원하는 때마다 원하는 값으로 변경할 수 있습니다. –
몇 가지 예를 들어 주시겠습니까? – Anton