Skip to content

Commit

Permalink
Fallback to default cell background color on nil. (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii Samsoniuk authored and ajsecord committed Jul 12, 2017
1 parent 0b905c6 commit 3c92cfe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/Collections/src/private/MDCCollectionViewStyler.m
Expand Up @@ -528,8 +528,11 @@ - (UIImage *)backgroundImageForCellLayoutAttributes:(MDCCollectionViewLayoutAttr
// Get cell color.
UIColor *backgroundColor = _cellBackgroundColor;
if ([_delegate respondsToSelector:@selector(collectionView:cellBackgroundColorAtIndexPath:)]) {
backgroundColor =
UIColor *customBackgroundColor =
[_delegate collectionView:_collectionView cellBackgroundColorAtIndexPath:attr.indexPath];
if (customBackgroundColor) {
backgroundColor = customBackgroundColor;
}
}

NSPointerArray *cellBackgroundCache = _cellBackgroundCaches[backgroundColor];
Expand Down

0 comments on commit 3c92cfe

Please sign in to comment.