美文网首页
UITableView分割线补全方法

UITableView分割线补全方法

作者: Luy7788 | 来源:发表于2016-05-24 01:12 被阅读48次
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
        [cell setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
        [cell setPreservesSuperviewLayoutMargins:NO];
    }
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]){
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
}

相关文章

网友评论

      本文标题:UITableView分割线补全方法

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