У меня есть 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
.