Objective-c – Dynamically change UITableView cell separator line color

cocoa-touchiphoneobjective cuicoloruitableview

Can anyone give sample code how to change the UITableView cell separator line color dynamically?

Best Answer

i assumed asking about tableview seperator color

use switch to all color then like this u can

 [tableview setSeparatorColor:[UIColor grayColor]];

OR

Here R, G, B are float for different Color value.

 [tableview setSeparatorColor:[UIColor colorWithRed:R green:G blue:B alpha:1]];

Often I use this below code

 [tableview setSeparatorColor:[UIColor colorWithRed:190/255.0f green:195.0/255.0f blue:199.0/255.0f alpha:1]];