UICollectionViewCell
이 포함 된 UICollectionView
이 있습니다. 컬렉션보기에는 배경 이미지가 있습니다. 배경 이미지를 표시 하겠지만 컬렉션보기 (또는 셀)는 항상 내 배경 이미지가 표시되지 않도록하는 흰색 배경을가집니다.배경색 사용자 정의 배경색
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
AgendaCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:agendaCellIdentifier forIndexPath:indexPath];
cell.delegate = self;
cell.layer.borderWidth=0.0f;
cell.layer.backgroundColor = [UIColor clearColor].CGColor;
cell.contentView.layer.backgroundColor = [UIColor blackColor].CGColor;
cell.layer.shouldRasterize = YES;
cell.layer.rasterizationScale = [UIScreen mainScreen].scale;
[cell setCurrentDateAtIndex:([indexPath row]) date:currentMonth events:events];
return cell;
}
AgendaCollectionCell
은 매우 간단하다 : 다음은 코드 나는 IB를 사용하여 셀을했고, clearColor 모든 배경 이미지를 설정합니다. 또한 콜렉션 뷰는 매우 기본적인 사용자 정의 레이아웃을 사용합니다. 은 PIC에 표시되는 내용의 excertp : 번호
컬렉션보기 쇼 세포. 컬렉션보기 아래에는 셀의 흰색 색상 때문에 배경이 표시되지 않습니다. 힌트를 보내 주시면 감사하겠습니다. 고맙습니다.
[cell.backgroundView addSubView .. 시도해보십시오. – iPatel
addSubView ... 추가 할 내용은 무엇입니까 ?? – giuseppe
그것에 UIImageView. – iPatel