Reputation: 141
If I touch first row, it will get highlighted. If I touch second row, first row highlighting is not there and second row is highlighted in table view of iOS. I want to highlight (multiple) both rows.
Here is my Code
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UIView *selectionColor = [[UIView alloc] init];
selectionColor.backgroundColor = [UIColor grayColor];
cell.selectedBackgroundView = selectionColor;
}
Upvotes: 0
Views: 493
Reputation: 12344
Use
self.tableView.allowsMultipleSelection = YES;
property of UITableView.
Upvotes: 3