UITableView去掉分隔符

或用代码实现

[TableView setSeparatorColor:[UIColor clearColor]]; 

问题一用你给的方法貌似不行,我用这个方法把分隔线给“去掉”了:
    [editViewController.tableView setBackgroundColor:[UIColor clearColor]];
    [editViewController.tableView setSeparatorColor:[UIColor clearColor]];

问题一,用上面的方法是最好不过了。为什么不行呢。是因为。。。你的TableView没有设为透明。。。

[editViewController.tableView setBackgroundColor:[UIColor clearColor]];这个也 是关键。。呵,,忽略掉了。不好意思。。

用setSeparatorstyle吧,,, 

tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

separatorStyle还可以设为其他值:

typedef enum {
UITableViewCellSeparatorStyleNone,
UITableViewCellSeparatorStyleSingleLine,
UITableViewCellSeparatorStyleSingleLineEtched   // This separator style is only supported for grouped style table views currently
} UITableViewCellSeparatorStyle; 

在didSelectRowAtIndexPath不要执行该cell任何事件, 这样只是不做事件的处理,但是cell的颜色还是会因为touch事件而改变这样用户的体验就不会太好!
我现在就是想实现一个类似iPhone短信里面添加收件人的那种界面?
如果要实现那种效果,用talbview到底行不行?




cell.selectionStyle = UITableViewCellSelectionStyleNone;
这个就是touch没有颜色了。。你没试? 

原文地址:https://www.cnblogs.com/worldtraveler/p/4565782.html