UITableView Cells separated by dotted lines

cocoa-touch, iphone

Solution

Try the solutions below:

self.tableView.separatorColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Dottedlineimage"]];   

note:Don't forget to turn off the default separator style for the table view in both the solutions: `[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];`

=====================OR TRY THIS===========================================

UIImageView *aLine = [[UIImageView alloc] initWithFrame:CGRectMake(cell.frame.origin.x, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height)];
 [aLine setImage:[UIImage imageNamed:@"yourDottedImage.png"]];
 [cell.contentView addSubview:aLine];
 [aLine release];  

H appy to help:)

Problem

I'd like to change the separator from a UITableView to a dotted line. All I could find is UITableViewCellSeparatorStyleBlabla... Can I put something else instead? I'd rather not use images, but if there is no other way... Thanks!

Original source