3

我想删除 的边框UITableView,默认情况下,单元格之间和表格周围有一条灰线。注意我只想删除表格周围的边框,而不是单元格之间的分隔符。

我已经搜索但只找到删除所有行的答案。此代码删除了单元格和表格周围和之间的所有边框:

self.table.separatorColor = [UIColor clearColor];
self.table.separatorStyle = UITableViewCellSeparatorStyleNone;

此代码不起作用,没有任何反应:

#import <QuartzCore/QuartzCore.h>
self.table.layer.borderColor = [UIColor redColor].CGColor;

我的表格是分组表格视图,默认在xib中,分隔符是单行。

4

5 回答 5

1

我有同样的问题,我所做的是删除边框并在自定义 TableViewCell 底部使用 Imageview 添加自定义分隔符。

于 2013-04-25T06:14:35.843 回答
1

尝试这个。

self.yourTableView.tableHeaderView = [[UIView alloc] init];
self.yourTableView.tableFooterView = [[UIView alloc] init];
于 2014-04-14T09:55:34.743 回答
0

我有同样的问题并找到了这个解决方案......

self.table.backgroundColor = [UIColor clearColor];

self.table.backgroundView = nil;

希望对你有帮助!

于 2013-06-12T17:37:05.353 回答
0

尝试设置 tebleview 边框 witdth = 0

于 2013-04-25T12:00:10.963 回答
-5

请尝试:

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
于 2013-04-25T06:22:39.107 回答