【发布时间】:2013-09-28 16:14:39
【问题描述】:
有谁知道,UICollectionView 在向上/向下滚动时使用什么方法。 我需要在向下滚动时更改 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;
}
但是当我向上滚动时它会增加月份。有没有分别表示向上滚动和向下滚动的方法?
谢谢
【问题讨论】:
标签: ios objective-c scroll uicollectionview