gpt4 book ai didi

ios - 更改UITableView分组单元格边框的颜色

转载 作者:行者123 更新时间:2023-12-01 17:49:35 25 4
gpt4 key购买 nike

我已经尝试了几乎所有内容,但似乎没有任何效果。我正在尝试更改uitableview或uitableViewCell的边框颜色,我无法真正分辨出它是哪一个。这是显示我在说什么的图像,它是默认的灰色边框。试图看到,但顶部和底部大约是1像素,然后是单元格之间的分隔线。

enter image description here

这是我尝试过的:

tableView.backgroundColor = Styles.blackColor()
cell.layer.borderColor = UIColor.yellowColor().CGColor

样式是我保留所有视觉设置的类,只是返回UIColors。

最佳答案

如果要更改颜色:

tableView.separatorColor = UIColor.yellowColor()

如果您只想删除它:
tableView.separatorStyle = .None

如果要使分隔符全宽:
    cell.separatorInset = UIEdgeInsetsMake(0, 0, cell.frame.size.width, 0)
if (cell.respondsToSelector("preservesSuperviewLayoutMargins")){
cell.layoutMargins = UIEdgeInsetsZero
cell.preservesSuperviewLayoutMargins = false
}

关于ios - 更改UITableView分组单元格边框的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35190178/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com