1
나는 UICollectionview
섹션과 2 개의 셀 클래스가 있습니다.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
을 바꿀 필요가있다. 먼저 cellCalendar
으로 이동하려면 cellCalendarEmpty
을 사용합니다. 경우의 두 가지 (모든 경우) 구성, 예를 처리하여