UITableViewCell separatorInsets in iOS 7

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

+4
source share
2 answers

Use the following method:

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

In iOS7, the table view has 15 left inserts for the separator by default, you can change it according to your requirement using the code above.

+1
source
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine];

According to the documentation,

UITableViewCellSeparatorStyleSingleLineThere is one line in the separator cell that runs across the entire width. This is the default value. Available in iOS 2.0 and later.

0
source

Source: https://habr.com/ru/post/1532424/


All Articles