Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在UITableView中删除页眉/页脚/单元格之间的分隔_Ios_Swift_Uitableview - Fatal编程技术网

Ios 在UITableView中删除页眉/页脚/单元格之间的分隔

Ios 在UITableView中删除页眉/页脚/单元格之间的分隔,ios,swift,uitableview,Ios,Swift,Uitableview,我有一个问题,细胞之间的线,只是不想离开 我试过以下方法 在代码和界面生成器中将分隔符样式设置为.None 将contentView的帧CGRect的大小增加1px 页眉、页脚和单元格的cliptobunds到true 无论我做什么,我似乎都无法摆脱这两者之间的界线: 启动我的TableView: @IBOutlet weak var tableView: UITableView! { didSet { tableView.contentInset = UIEdge

我有一个问题,细胞之间的线,只是不想离开

我试过以下方法

  • 在代码和界面生成器中将分隔符样式设置为
    .None
  • contentView
    的帧
    CGRect
    的大小增加1px
  • 页眉、页脚和单元格的
    cliptobunds
    true
无论我做什么,我似乎都无法摆脱这两者之间的界线:

启动我的TableView:

@IBOutlet weak var tableView: UITableView! {
    didSet {
        tableView.contentInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)
        tableView.clipsToBounds = true
        tableView.separatorInset = UIEdgeInsetsZero
        tableView.separatorStyle = .None

        if let nib = NSBundle.mainBundle().loadNibNamed(LobbySliderHeaderCollectionReusableView.classIdentifier, owner: self, options: nil).first as? LobbySliderHeaderCollectionReusableView {
            tableView.tableHeaderView = nib
        }
    }
}

大厅页眉单元格(页脚和单元格类似):


尝试为分离器设置clearColor

 tableView.separatorColor = UIColor.clearColor()

尝试为分离器设置clearColor

 tableView.separatorColor = UIColor.clearColor()

您的单元格视图似乎来自Xib。 xibs中的
UITableViewCell
组件通常在底部有一个1像素的边距(在
contentView
tableViewCell
之间)


尝试在
单元格中添加子视图。contentView
并使其背景视图高度比contentView大1像素。

您的单元格视图似乎来自Xib。 xibs中的
UITableViewCell
组件通常在底部有一个1像素的边距(在
contentView
tableViewCell
之间)


尝试在
单元格中添加子视图。contentView
并使其背景视图高度比contentView大1个像素。

是tableView的红色/蓝色背景部分吗?或者它来自细胞背景?它是细胞的一部分。它被设置为
cell.fillColor
,而属性observer
didSet
则反过来设置为
contentView.backgroundColor
。红色/蓝色背景是tableView的一部分吗?或者它来自细胞背景?它是细胞的一部分。它被设置为
cell.fillColor
,然后通过属性observer
didSet
将其设置为
contentView.backgroundColor
。您是否尝试在cell.backgroundColor=color.fillColor=color附近添加cell.backgroundColor=color?实际上……我不知道您在fillColor的setter中做什么,但我很确定这个问题与分隔符无关。你有没有尝试在单元格附近添加cell.backgroundColor=color.fillColor=color?事实上……我不知道你在fillColor的setter中做什么,但我很确定这个问题与分隔符无关。单元格嵌入到情节提要中。唯一没有显示的单元格是tableHeader(图中未显示)。尽管在情节提要中,
contentView
的约束不能更改。我试着增大视图的大小,但我不相信它有效。现在将再次尝试该解决方法。
contentView
的框架无法更改。这就是为什么您必须使用比1像素的
contentView
大的新子视图。根据您的编辑,您还可以尝试使用
self.backgroundColor=fillColor
更新单元格的
fillColor
设置器,并将
contentView.backgroundColor
设置为
clearColor()
单元嵌入到故事板中。唯一没有显示的单元格是tableHeader(图中未显示)。尽管在情节提要中,
contentView
的约束不能更改。我试着增大视图的大小,但我不相信它有效。现在将再次尝试该解决方法。
contentView
的框架无法更改。这就是为什么您必须使用比1像素的
contentView
大的新子视图。根据您的编辑,您还可以尝试使用
self.backgroundColor=fillColor
更新单元格的
fillColor
设置器,并将
contentView.backgroundColor
设置为
clearColor()
 tableView.separatorColor = UIColor.clearColor()