Reputation: 4409
All
How to remove separate line from UITableView Cell Row. I try it but still a separate line is drawn in UITableViewCell Row.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.selectionStyle = UITableViewCellSeparatorStyleNone;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.backgroundColor = [UIColor colorWithRed:217.0/255.0 green:235.0/255.0 blue:244.0/255.0 alpha:1.0];
cell.textLabel.text = LOREM;
[cell.textLabel setFont:[UIFont fontWithName:@"GillSans" size:12.0]];
cell.textLabel.numberOfLines = 0;
return cell;
}
Upvotes: 1
Views: 1130
Reputation: 1724
Try this from Nib
file. Select your tableview
and make Separator
None
Upvotes: 2
Reputation:
Use:
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
Upvotes: 1
Reputation: 14040
try and put self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
into your viewDidLoad...
instead of cellForRow...
...
Upvotes: 2