kiran
kiran

Reputation: 4409

How to remove separate line from tableview row cells?

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

Upvotes: 1

Views: 1130

Answers (3)

Atanu Mondal
Atanu Mondal

Reputation: 1724

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

enter image description here

Upvotes: 2

user5938635
user5938635

Reputation:

Use:

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

Upvotes: 1

André Slotta
André Slotta

Reputation: 14040

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

Upvotes: 2

Related Questions