iphone - UITableViewCell 去除每行之间的白色并显示 UIView 的背景图像

标签 iphone ios xcode uitableview

这是我的应用程序的图像

My app image

如您所见,每一行都有白线。我怎样才能摆脱那条线。

这是我完成的单元格代码

cell.backgroundView = [ [[UIImageView alloc] initWithImage:[ [UIImage imageNamed:@"conta.png"] stretchableImageWithLeftCapWidth:0.0 topCapHeight:5.0] ]autorelease];   
cell.textLabel.backgroundColor=[UIColor clearColor];
cell.textLabel.text = [tableArray objectAtIndex:indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
tableView.backgroundColor=[UIColor clearColor];
return cell;

我需要擦掉每一行的白线。我怎样才能做到这一点?

最佳答案

在设置表格 View 期间的某处,您可以将分隔符样式设置为“无”。这可以在界面构建器 Storyboard/ Nib 中完成,也可以在代码中完成,例如:

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

关于iphone - UITableViewCell 去除每行之间的白色并显示 UIView 的背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11349187/

相关文章:

ios - 如何读取UIPicker选中的文本

iphone - 安装 Xcode 6 iOS Simulator 8 后皮肤消失

ios - 电话调用 - 使用 xCode 8.1 的 Swift 3

ios - 正则表达式在 swift 2 中获取 vimeo 视频 ID

xcode - 网络核心 NSBeep()!从 uiwebview 复制时

iphone - 如何改进此“DateFromNextWeekDay:FromDate”方法代码?

iphone - Game Center - 发送和接收数据

iphone - 在 UICollectionView 中加载大量图像时性能不佳

ios - 从 iOS 中的 MKMapKit 中删除学校、商店

ios - 当我在 Swift 中使用 PHAsset 时,我总是收到内存警告