首页 > 学院 > 开发设计 > 正文

IOStableVIewcell横线左端对其

2019-11-14 19:09:42
字体:
来源:转载
供稿:网友

需要将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];
    }
    
}


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表