简体   繁体   English

删除行分隔符但不删除UITableView中的边框

[英]Removing the line separator but not the border in a UITableView

I want to remove the line separator in a grouped table view cell, but not the border of the table. 我想删除分组表视图单元格中的行分隔符,但不删除表格的边框。 I used this code to remove the separator but it removes the border also: 我使用此代码删除分隔符,但它也删除了边框:

profileTable.separatorColor:[UIColor clearColor];

The screen shot explains what I need . 屏幕截图解释了我的需求

Is there any code available to remove it? 有没有可用的代码删除它?

屏幕截图

以下代码可能对您有所帮助。

profileTable.separatorStyle = UITableViewCellSeparatorStyleNone;

One solution to your problem, could be to create a custom layout for your grouped tableview. 解决您的问题的一种方法是为您的分组tableview创建自定义布局。 So you would create a top, middle and bottom part of the cells, and then add a border only to the sides. 因此,您将创建单元格的顶部,中间和底部,然后仅向边添加边框。

I used this tutorial: http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html 我使用了这个教程: http//cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html

var tableView = Ti.UI.createTableView({ separatorColor: 'transparent', backgroundColor: '#FFFFFF' });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM