// 分割线 View
UIView *lineLabel = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableviewWith, 0.5)];
lineLabel.backgroundColor = HEADER_LINE_COLOR;
[headview addSubview:lineLabel];
分割线应该使用 view ,view的高度可 为1, label 至少为2。
修改系统自动 cell 分割线
- (void) setTableview {
// 隐藏cell分割线
// self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
// 改变iOS7 tableView的分割线长、颜色
if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) {
// cell分隔线距离左边边距 space
CGFloat space = ViewWidth * 25.0f / 750.0f;
[self.tableView setSeparatorInset:UIEdgeInsetsMake(0.0, space, 0.0, 0.0)];
// cell分隔线的颜色
// [self.tableView setSeparatorColor:ColorWithRGBA(18.0, 18.0, 18.0, 10.0)];
}
}