在 IB 中,
样式:分组,单线蚀刻,白色。我的视图的背景是清晰的颜色。
在这个 ViewController 的 viewDidLoad 中,我创建了一个虚拟背景视图:
UIView *tableBgView = [[UIView alloc] initWithFrame:self.tableView.frame];
tableBgView.backgroundColor = [UIColor clearColor];
self.tableView.backgroundView = tableBgView;
[tableBgView release];
在 cellForRowAtIndexPath 我有:
UIView *bgView = [[UIView alloc] initWithFrame:cell.bounds];
bgView.backgroundColor = [UIColor clearColor];
cell.backgroundView = bgView;
[bgView release];
我想要做的是使用矩形背景而不是圆角矩形来查找分组表,并且因为在我的 cellForRowAtIndexPath 中我创建了一个 clearColor backgroundView 来摆脱圆角矩形外观,所以我不再有分隔符了。我是否只需在此 bgView 底部添加另一个单像素 UIView 行来获取我的分隔符?或者,还有更好的方法?谢谢。