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!
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:)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With