Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize UITableView section border color for each section

I am using a UITableView with grouping. My first group I have built a custom cell with no background color, and I would also like to remove the border around the cell. How can I do this just for one section?

For my first cell, I would like to set the border/seperator style to [UIColor clearColor].

enter image description here

EDIT: Apple does this in their contacts app, and I wanted to design something similar.

like image 532
Nic Hubbard Avatar asked Dec 29 '22 02:12

Nic Hubbard


1 Answers

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {

if(indexPath.section == 0){

cell.backgroundView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];

  }
}
like image 181
Rinju Jain Avatar answered Mar 07 '23 15:03

Rinju Jain