首页 > 其他 > 详细

UITableView去掉分隔符

时间:2015-06-10 14:05:04      阅读:192      评论:0      收藏:0      [点我收藏+]

或用代码实现

[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没有颜色了。。你没试? 

UITableView去掉分隔符

原文:http://www.cnblogs.com/worldtraveler/p/4565782.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!