collectionView cell
을 선택하여 다시로드했지만보기가 첫 번째 선택시 표시되지 않습니다. 은 다시 셀을 클릭 할 때만 표시됩니다. collectionView의 첫 번째로드는 collectionView 셀의 첫 번째 선택에서 추가 된 뷰가 추가되지만 보이지는 않지만 크기는 증가하고 두 번째 선택 후에 뷰만 표시됩니다.uicollectionview에 추가 된보기가 선택 중에 추가 된 셀이 표시되지 않습니다.
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
selectedIndexPath = indexPath;
PastPicksGameCollectionViewCell *cell = (PastPicksGameCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(50,122, 150, 120)];
[view setBackgroundColor:[UIColor blueColor]];
[cell.contentView addSubview:view]
[pastPicksGameCollectionView reloadItemsAtIndexPaths:@[selectedIndexPath]];
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
if ([indexPath isEqual:selectedIndexPath]) {
return CGSizeMake(320, 200);
}
return CGSizeMake(300, 120);
}