如何使Tableview中的分隔符(单行)透明?
我在我的应用程序中使用了表视图,并且在其中使用了表视图给出的单行分隔符。 如何在表格视图中制作透明分隔符?
如果有人有任何想法/代码片段/有用的链接,我将不胜感激。
I have used table view in my application, and within that I have used the single line separator given by tableview.
How can I make a transparent separator in a tableview?
If anybody has any ideas/code snippets/useful links, I would greatly appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这很简单
在你的 viewdidload 中使用这个
[yourTableView setSeparatorColor:[UIColor clearColor]];
it's very simple
in your viewdidload use this
[yourTableView setSeparatorColor:[UIColor clearColor]];
以防万一有人仍在寻找具有任何高度的“透明”分隔符的解决方案:
在自定义 UITableViewCell 内:
Just in case someone is still looking for solution with 'transparent' separator of any height:
Inside custom UITableViewCell:
只需使用
tableView.separatorColor = .clear
Just use
tableView.separatorColor = .clear