如何在 xcode (objective c) 中更改框架的颜色

How to change color of frames in xcode (objective c)

所以我使用了这段代码:

- (void)setFrame:(CGRect)frame {
    frame.origin.y += 4;
    frame.size.height -= 2 * 4;
    [super setFrame:frame];
}

我从本网站的一篇帖子中看到在我的自定义单元格之间放置空格。我想知道是否有办法改变它的颜色?目前是白色的。或者是否有办法让它透明?

如果要在单元格之间 space 着色,请尝试:

tableView.backgroundColor = [UIColor clearColor]; // This should give you transparent color 

我尝试了这个并且成功了:

UIView* separatorLineView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 500, 10)];
    separatorLineView.backgroundColor = [UIColor colorWithRed:206/255.0 green:191/255.0 blue:170/255.0 alpha:1.0];
    [cell.contentView addSubview:separatorLineView];