【发布时间】:2014-06-05 14:24:28
【问题描述】:
如何去除单元格和角落之间的白色我在容器视图中使用了清晰的颜色,但没有去除白色。
我采用表格视图上的自定义单元格。 cell.contentView.backgroundColor= [UIColor clearColor]; cell.contentView.layer.cornerRadius=10;
【问题讨论】:
标签: ios objective-c uitableview
如何去除单元格和角落之间的白色我在容器视图中使用了清晰的颜色,但没有去除白色。
我采用表格视图上的自定义单元格。 cell.contentView.backgroundColor= [UIColor clearColor]; cell.contentView.layer.cornerRadius=10;
【问题讨论】:
标签: ios objective-c uitableview
设置 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 中设置你需要的颜色。
【讨论】: