UITableView setSeparatorColor
@property(nonatomic, retain) UIColor *separatorColor
Discussion of [UITableView setSeparatorColor]
The default color is gray.
UITableView setSeparatorColor example.
- (void)viewDidLoad
{
[self.tableView setSeparatorColor:[UIColor myColor]];
}
{
[self.tableView setSeparatorColor:[UIColor myColor]];
}
Example of [UITableView setSeparatorColor].
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.section) {
case 0:
tableView.separatorColor = nil;
break;
case 1:
switch (indexPath.row) {
case 0:
tableView.separatorColor = nil;
break;
case 1:
tableView.separatorColor = [UIColor clearColor];
break;
default:
break;
}
break;
default:
break;
}
switch (indexPath.section) {
case 0:
tableView.separatorColor = nil;
break;
case 1:
switch (indexPath.row) {
case 0:
tableView.separatorColor = nil;
break;
case 1:
tableView.separatorColor = [UIColor clearColor];
break;
default:
break;
}
break;
default:
break;
}
UITableView setSeparatorColor example.
UITableView * tempTable = [[UITableView alloc] init];
[table setSeparatorColor:tempTable.separatorColor];
[table setSeparatorStyle:tempTable.separatorStyle];
table.backgroundView = tempTable.backgroundView;
[table setSeparatorColor:tempTable.separatorColor];
[table setSeparatorStyle:tempTable.separatorStyle];
table.backgroundView = tempTable.backgroundView;