0

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;
} 

Error Image:- enter image description here

kiran
  • 4,285
  • 7
  • 53
  • 98

3 Answers3

1

try and put self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; into your viewDidLoad... instead of cellForRow......

André Slotta
  • 13,774
  • 2
  • 22
  • 34
  • Slotta I try it but still its not working . I used UITableViewController for the class. and set non in my XIB but still its drawing seperator line in each cell. – kiran May 24 '16 at 04:29
1

Try this from Nib file. Select your tableview and make Separator None

enter image description here

Atanu Mondal
  • 1,714
  • 1
  • 24
  • 30
0

Use:

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];