如何删除顶部单元格分隔线 [英] How to remove top cell separator line

查看:82
本文介绍了如何删除顶部单元格分隔线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何摆脱状态栏上方出现的分隔线?在屏幕截图中很难看到它,所以我将其涂成红色.我在第一个单元格中尝试了下面的代码,但这没用.

How do I get rid of the separator line appearing above the status bar? It's hard to see in a screenshot, so I colored it red. I tried the code below for the first cell, but that didn't work.

cell.separatorInset = UIEdgeInsetsMake(0.f, 0.f, 0.f, 0.0f);

推荐答案

实现tableView:viewForHeaderInSection:tableView:heightForHeaderInSection:

tableView:viewForHeaderInSection:中返回矩形为零的视图,即[UIView alloc] initWithFrame:CGRectZero]

In tableView:viewForHeaderInSection: return a view with zero rect i.e [UIView alloc] initWithFrame:CGRectZero]

tableView:heightForHeaderInSection:中,返回高度为0.01.

In tableView:heightForHeaderInSection: return height as 0.01.

如果您在表格视图中有多个部分,请记住该部分.

Mind section if you have multiple sections in table view.

这篇关于如何删除顶部单元格分隔线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆