selectedBackgroundView (#2875)

This commit is contained in:
Vadim Novoseltsev 2017-02-15 21:37:45 +03:00 committed by Adlai Holler
parent 6af131b093
commit b6935448d6
3 changed files with 8 additions and 0 deletions

View File

@ -169,6 +169,12 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
*/
@property (nonatomic) UITableViewCellSelectionStyle selectionStyle;
/* @abstract The view used as the background of the cell when it is selected.
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.
* ASCollectionView uses these properties when configuring UICollectionViewCells that host ASCellNodes.
*/
@property (nonatomic, strong, nullable) UIView *selectedBackgroundView;
/* @abstract The accessory type view on the right side of the cell. Please take care of your ASLayoutSpec so that doesn't overlay the accessoryView
* @default UITableViewCellAccessoryNone
* ASTableView uses these properties when configuring UITableViewCells that host ASCellNodes.

View File

@ -952,6 +952,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier";
if (_ASCollectionViewCell *asCell = ASDynamicCast(cell, _ASCollectionViewCell)) {
asCell.node = node;
asCell.selectedBackgroundView = node.selectedBackgroundView;
[_rangeController configureContentView:cell.contentView forCellNode:node];
}

View File

@ -853,6 +853,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
[_rangeController configureContentView:cell.contentView forCellNode:node];
cell.node = node;
cell.selectedBackgroundView = node.selectedBackgroundView;
}
return cell;