IOS tableVIewcell横线左端对其

需要将tableview初始化及绘制单元格代理中添加如下代码:

//初始化添加

self.tableView_chose =[ [UITableView alloc] init];

 if ([self.tableView_chose respondsToSelector:@selector(setSeparatorInset:)]) {
        [self.tableView_chose setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([self.tableView_chose respondsToSelector:@selector(setLayoutMargins:)]) {
        [self.tableView_chose 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];
    }
    
}

posted @ 2015-04-29 12:13  没落云端  阅读(422)  评论(0编辑  收藏  举报