我在表视图分隔符方面遇到了一个非常奇怪的问题。我已将分隔符颜色设置为深灰色,这在单元格下方效果很好,但由于某种原因,我的部分标题之前有一个白色分隔符(请参见 11 月上方的屏幕截图)。当我将分隔符样式设置为无时,该线消失,表明它是分隔符。如何去掉这条白色分隔线?
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 1)];
UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(0, -1, 320, 2)];
view2.backgroundColor = [UIColor blackColor]; // Your color
view1.backgroundColor = [UIColor blackColor]; // Your color
[view1 addSubview:view2];
return view1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return 0.01;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)