1
我有UICollectionview
分区和两个单元类。UICollectionViewCell更改背景颜色
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
myCell *cell;
firstDayInMonth = [self dayWeekStart:[self getDateFromItem:dateFromStart section:indexPath.section row:1]];
if (indexPath.row < firstDayInMonth) {
cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cellCalendarEmpty" forIndexPath:indexPath];
} else {
cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cellCalendar" forIndexPath:indexPath];
}
}
我有开始项目,部分和期间。从开始部分开始,我需要根据周期更改背景颜色单元格。我只需要改变cellCalendar
。我使用cellCalendarEmpty
先移动cellCalendar
。