如何去除单元格和角落之间的白色我在容器 View 中使用了清晰的颜色,但没有去除白色。
我在表格 View 中使用自定义单元格。
cell.contentView.backgroundColor= [UIColor clearColor];
cell.contentView.layer.cornerRadius=10;
最佳答案
设置 UITableView 样式分组。并将每个单元格设置在不同的部分。然后在下面添加代码:
- (float)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
//this is the space
return 50;
}
要更改单元格之间的颜色,您应该执行以下操作:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 5)];
v.backgroundColor = [UIColor whiteColor];
return v;
}
如果你想改变背景的颜色,你应该在 cell.contenrView.backgroundColor 中设置你需要的颜色。
关于ios - 如何设置表格 View 单元格之间的空间并删除背景内容 View 的白色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24062778/