Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use an image as the UITableView separator

I got an UITableView on my project and I need to customize the separator. I want to use an image instead of a color. I tried using the +colorWithPatternImage: UIColor method with no luck.

like image 589
Fernando Valente Avatar asked Jul 31 '10 12:07

Fernando Valente


2 Answers

use this code i use it in my application this will work

UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image name"]];
[self.tableview setSeparatorColor:color];
like image 152
priyanka Avatar answered Nov 16 '22 00:11

priyanka


As far as I know you can't. What you can do however is to set the separator to none and then add the image you want to use as a separator to the cell view.

like image 21
Ron Srebro Avatar answered Nov 15 '22 22:11

Ron Srebro