thndrkiss
thndrkiss

Reputation: 4595

How to remove separator from tableview?

I used interface builder and changed my tableview style as grouped and separator as none.

I was able to see the change in the display style which is grouped right now. But the separator change is not getting reflected.

How to remove the separator?

Upvotes: 1

Views: 1710

Answers (2)

user1760527
user1760527

Reputation: 1164

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];

Upvotes: 0

sagarkothari
sagarkothari

Reputation: 24810

Ok - Just do this.

If you have rootViewController, in viewDidLoad method - just place following line. ( Default view controller in "Navigation based application")

Whatever view controller you have to place following code.

- (void)viewDidLoad
{
    [super viewDidLoad];
    // if it your view controller extends - UITableViewController
    [self.tableView setSeparatorColor:[UIColor clearColor]];
        // or 
        // your placed tableVCtr on .xib & have datasource & delegate & table connections
        [mytableVCtr setSeparatorColor:[UIColor clearColor]];
}

Upvotes: 3

Related Questions