Reputation: 16512
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
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
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