应用场景:例如搜索时候只有一条数据,其他空白cell分割线隐藏起来
UIView *view = [[UIView alloc] init];
[view setBackgroundColor:[UIColor clearColor]];
self.tableView.tableFooterView = view;
为了方便其他地方用,可以给tableView写分类
@interface UITableView (Additions)
- (void)dx_hideTableEmptyDataSeparatorLine;
@end
- (void)dx_hideTableEmptyDataSeparatorLine {
UIView *view = [[UIView alloc] init];
[view setBackgroundColor:[UIColor clearColor]];
self.tableFooterView = view;
}
网友评论