如果我触摸第一行,它将突出显示。如果我触摸第二行,则第一行不会突出显示,第二行会在 iOS 的表格 View 中突出显示。 我想突出显示(多个)两行。
Here is my Code
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UIView *selectionColor = [[UIView alloc] init];
selectionColor.backgroundColor = [UIColor grayColor];
cell.selectedBackgroundView = selectionColor;
}
最佳答案
使用
self.tableView.allowsMultipleSelection = YES;
UITableView 的属性。
关于ios - 如何使用 objective-C 在 TableView 中突出显示多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32310758/