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
。