iOS开发--改变iOS7上tableview的分割线长、颜色问题

# 改变iOS7上tableview的cell颜色问题

if ([  self .  tableView respondsToSelector :  @selector (setSeparatorInset:)]) { 

        [ self . tableView setSeparatorInset  : UIEdgeInsetsZero ];

[  self .  tableView setSeparatorColor :  kGetColor (  18.0 ,  18.0 ,  18.0 )]; 

}

# 改变iOS7上tableview的分割线长度问题

    if ([tableVi respondsToSelector : @selector (setSeparatorInset:)]) {

        [tableVi setLayoutMargins:UIEdgeInsetsZero];

        [tableVi setLayoutMargins:UIEdgeInsetsZero];

        

    }

//tableview顶格

-(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];

    }

}




#去掉UITableView中的某cell条分割线

if (indexPath.  section ==  0 && indexPath.  row ==  1 ) { 

[cell setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 10000000)]; 

}


你可能感兴趣的:(iOS开发--改变iOS7上tableview的分割线长、颜色问题)