1.初始化的时候 写上这2句
_listTable = [[UITableView alloc]initWithFrame:CGRectMake(2, 9, SIZE_WIDTH(_bgImageView)-4, SIZE_HEIGHT(_bgImageView)-10)];
[_listTable setSeparatorInset:UIEdgeInsetsZero];
[_listTable setLayoutMargins:UIEdgeInsetsZero];
2,在代理方法写上
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString * cellID = @"listViewCell";
ListViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[ListViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
}
cell.infoIcon.image = [[DLManager sharedInstance].themeProxy DLImage:IMAGE_ARRAY[indexPath.row]];
cell.infoLabel.text = TITLE_ARRAY[indexPath.row];
cell.selectionStyle = UITableViewCellSeparatorStyleNone;
[cell setSeparatorInset:UIEdgeInsetsZero];
[cell setLayoutMargins:UIEdgeInsetsZero];
return cell;
}
[cell setSeparatorInset:UIEdgeInsetsZero];
[cell setLayoutMargins:UIEdgeInsetsZero];
这2句就行了
上面方法有问题 只能适用于IOS8
IOS7的 只能用这个
_listTable.separatorInset =UIEdgeInsetsMake(0,0, 0,0);