First, the problem description
UITableView split line to show to the leftmost side
View the properties of the UITableView and find that setting the value of Separatorinset allows you to customize the position of the split line.
// allows customization of the frame of cell separators
Print Separatorinset with default values {0, 15, 0, 0}, top, left, bottom, and right distances are 0, 15, 0, 0, i.e. the left side will have a default 15-pixel blank
Use the following code to set the Uitableviewcontroller UITableView split line. Uiedgeinsetszero equivalent to Uiedgeinsetsmake (0, 0, 0, 0).
1-(void) Viewdidload2 {3 //set the style of a split line4Self.tableView.separatorStyle =Uitableviewcellseparatorstylesingleline;5 6 //set the distance from the boundary of the split line7 if([Self.tableview respondstoselector: @selector (setseparatorinset:)])8 {9Self.tableView.separatorInset =Uiedgeinsetszero;Ten } One}
Run, found not up to the effect I want, the split line is only the left side of the near, but still not show to the leftmost, as follows:
Second, the problem analysis
iOS Learning note 15:separatorinset setting UITableView's Split line invalid problem