UITableView - 摆脱分隔符(不仅仅是让它们清晰)
我有一个表格,通过交替背景颜色(深蓝色、浅蓝色)来分隔单元格,所以我想去掉分隔符。但是,将分隔符样式设置为无,虽然它似乎确实删除了分隔符,但不会将单元格推到一起(分隔符所在的位置仍然存在间隙,并且可以通过它看到背景)。我将分隔符颜色更改为其中一个单元格的颜色,它看起来不错,但它使其他所有单元格看起来都比它之前和之后的单元格大。虽然不太明显,但我还是想补救一下。我该怎么做?
I have a table that separates its cells by alternating backgrounds colors (dark blue, light blue) so I want to get rid of the separators. However, setting separator style to none, while it does seem to remove the separators, does not push the cells together (there is still a gap where the separator was and the background can be seen through it). I changed the separator color to the color of one of the cells, and it looks decent, but it makes every other cell look larger than the one before and after it. It's barely noticeable, but I'd still like to remedy it. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试在单元格底部添加一个高度为 1 px 的子视图并设置背景颜色。
并制作
我还没有测试过它,我希望这个工作:-)
You can try adding a subview at the bottom of the cell with 1 px height and set the background color.
And make the
I have not tested it and I hope this work :-)