어쩌면 문제는 내 사용자 지정 collectionView 셀에서
- (NSString *)getBackgroundImage:(NSIndexPath *)indexPath {
NSArray *indexes = [self.allColors[indexPath.section] objectForKey:@"indexes"];
return [NSString stringWithFormat:@"%@/%@/%@/combimeter_button/combimeter_%ld_%@@2x.png", [self.documentDirectory getDocumentsDirectory], _selectedCar, _selectedCar, (long)[indexes[indexPath.row] integerValue], [self getColorKey:indexPath.section]];
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
CustomCollectionViewCell *cell = (CustomCollectionViewCell *) [collectionView dequeueReusableCellWithReuseIdentifier:@"CustomCell" forIndexPath:indexPath];
cell.layer.borderWidth = 2.0f;
cell.layer.borderColor = [[self getBackgroundColor:indexPath.section] CGColor];
[cell.cellButton setBackgroundImage:[UIImage imageNamed:[self getBackgroundImage:indexPath]] forState:UIControlStateNormal];
[cell.cellButton addTarget:self action:@selector(combimeterButtonDidSelected:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
: 내 CollectionViewController에서
그 imageNamed:
이미지를 캐시합니다. 대신 imageWithContentsOfFile:
을 사용해보세요.
wt는 섹션 및 행에 대한 데이터 소스입니까? – kaushal
plist 파일에서 데이터를 가져 오는 중입니다. – Nuibb