开发者

How can I hide the row separators in a UITableView without hiding the group borders?

I have a grouped UITableView, a开发者_开发问答nd I want to hide the lines between the rows. When I set the separatorColor to clearColor, the lines disappear; but so does the border around the groups. Is there a way for me to hide the lines between the rows, but keep the border around the groups?


Writing this out of my head, and not sure if it would work. Give it a try

self.tableView.layer.borderColor = [UIColor grayColor].CGColor;
self.tableView.layer.borderWidth = 1.0f;

You need to import and add the necessary framework to the Build Phases section of your target.


Maybe is a bit later but I have a little "fix". In your cell view you have to add a UIView with the same color than your cell background and put it at the botton of your cell. This new view will put over the separator line. So you have to show it in every cell less the last one, using setHidden method. And here you have, no separator!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜