Berry Blue
Berry Blue

Reputation: 16512

UITableViewCell separatorInsets in iOS 7

How do you set the separatorInsets of a table view cell back to their default values programmatically? I want to change them for some cells but not others.

Upvotes: 4

Views: 1061

Answers (2)

Divya Bhaloidiya
Divya Bhaloidiya

Reputation: 5064

Use following way :

 if (indexPath.row == {your row number}){
        cell.separatorInset = UIEdgeInsetsMake(0, 15, 0, 0);
    }

In iOS7 table view has default 15 left inset for separator,you can change it as per your requirement by using above code.

Upvotes: 1

Arslan Ali
Arslan Ali

Reputation: 17812

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine];

According to documentation,

UITableViewCellSeparatorStyleSingleLine The separator cell has a single line running across its width. This is the default value. Available in iOS 2.0 and later.

Upvotes: 0

Related Questions