mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-15 18:59:54 +00:00
Fix setting selectedBackgroundView in collection view (#3131)
This commit is contained in:
parent
2df392261e
commit
d0ad24808b
@ -969,7 +969,6 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier";
|
||||
|
||||
if (_ASCollectionViewCell *asCell = ASDynamicCast(cell, _ASCollectionViewCell)) {
|
||||
asCell.node = node;
|
||||
asCell.selectedBackgroundView = node.selectedBackgroundView;
|
||||
[_rangeController configureContentView:cell.contentView forCellNode:node];
|
||||
}
|
||||
|
||||
@ -991,6 +990,10 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier";
|
||||
|
||||
ASCellNode *cellNode = [cell node];
|
||||
cellNode.scrollView = collectionView;
|
||||
|
||||
// Update the selected background view in collectionView:willDisplayCell:forItemAtIndexPath: otherwise it could be to
|
||||
// early e.g. if the selectedBackgroundView was set in didLoad()
|
||||
cell.selectedBackgroundView = cellNode.selectedBackgroundView;
|
||||
|
||||
// Under iOS 10+, cells may be removed/re-added to the collection view without
|
||||
// receiving prepareForReuse/applyLayoutAttributes, as an optimization for e.g.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user