Aar*_*ski 3 objective-c uitableview separator ios
我对表视图分隔符有一个非常奇怪的问题.我已将分隔符颜色设置为深灰色,在单元格下方工作得很好,但出于某种原因,在我的节标题之前有一个白色分隔符(请参见11月上方的屏幕截图).当我将分隔符样式设置为none时,该行消失,表示它是分隔符.如何删除此白色分隔线?

- (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;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1685 次 |
| 最近记录: |