- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (_partArr.count == 0) {
// 去掉tableView分割线 (没有分割线)
[tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
}else{
// 显示tableView分割线 (没有分割线)
[tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine];
}
return _partArr.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
SportsCircleTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SportsCircleCell" forIndexPath:indexPath];
//去掉底部多余的表格线
[tableViewsetTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
//最后一行分隔线顶头显示
staticvoid setLastCellSeperatorToLeft(UITableViewCell*cell)
{
if ([cellrespondsToSelector:@selector(setSeparatorInset:)]) {
[cellsetSeparatorInset:UIEdgeInsetsZero];
}
if ([cellrespondsToSelector:@selector(setLayoutMargins:)]) {
[cellsetLayoutMargins:UIEdgeInsetsZero];
}
if([cellrespondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
[cellsetPreservesSuperviewLayoutMargins:NO];
}
}
return cell;
}