全部
如何从 UITableView 单元格行中删除单独的行。 我试过了,但仍然在 UITableViewCell 行中绘制了一条单独的线。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.selectionStyle = UITableViewCellSeparatorStyleNone;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.backgroundColor = [UIColor colorWithRed:217.0/255.0 green:235.0/255.0 blue:244.0/255.0 alpha:1.0];
cell.textLabel.text = LOREM;
[cell.textLabel setFont:[UIFont fontWithName:@"GillSans" size:12.0]];
cell.textLabel.numberOfLines = 0;
return cell;
}
最佳答案
尝试将 self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
放入您的 viewDidLoad...
而不是 cellForRow...
...
关于ios - 如何从表格 View 行单元格中删除单独的行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37391673/