美文网首页
给tabelView每个cell上添加线段

给tabelView每个cell上添加线段

作者: 宝物 | 来源:发表于2016-06-13 20:06 被阅读0次

添加前

系统的会默认少一段

添加后


成功拼接
- (void)tabelViewfengexian{
    if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)])
    {
        [self.tableView setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([self.tableView respondsToSelector:@selector(setLayoutMargins:)])
    {
        [self.tableView setLayoutMargins:UIEdgeInsetsZero];
    }
}

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if ([cell respondsToSelector:@selector(setSeparatorInset:)])
    {
        [cell setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([cell respondsToSelector:@selector(setLayoutMargins:)])
    {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
}

相关文章

网友评论

      本文标题:给tabelView每个cell上添加线段

      本文链接:https://www.haomeiwen.com/subject/opwydttx.html